Micro Focus QTP (UFT) Forums

Full Version: How to pass index value run time.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am writing script for a scenario where I need to pass the index value of object during runtime, but its not working.

Code:
index=value
browser("browser").page("page").objectname("index:=&value").submit
Above code is not working.Is there any alternative solution for this?

Thanks,
Girish
Hi,

The double quotes are not used at right place. use this

Code:
browser("browser").page("page").objectname("index:="&value).submit

Regards,
Parminder
Hi,

Thanks for the suggestion but its showing the run time error.

Regards,
Girish.
In starting u r assigning the value to the variable index and later u r not using that variable to pass the value.
I should be like:
Code:
index=value
browser("browser").page("page").objectname("index:="&index).submit
Correct me if wrong.

Regards,
Sankalp
Hi All,

Still I am getting the run time error.

Thanks.
Hi,

It seems that the object has different index number than the one that you are providing. Try with some other index number.

If still not resolved then provide screenshot of OR and object spy.

Regards,
Parminder
See boss, ur actual qstion is not clear....wat exactly u want???

1. u have a particular index value which u want to pass-on in run time???
2. Or u want to get the index value in run time and dat value u want to pass on??

If ur requirement is d first one then d code must work wat sshukla12 has posted. And if it is not working, d reason is u did not provide proper index value to identify dat object uniquely. Try with proper index value and it will definitely work....


But if ur requirement is the 2nd one, then it is not possible boss....coz to get d index value in run time u need to identify dat object uniquely in run time which is not possible widout dat index value....so how u will get index value by GetRoProperty("index")?????Its Not possible....In this case, come up wid ur need then i can try to help u out....


-------------
Thanx.