Clicking a link having a text stored in variable
In my application, an auto-ID is created. I need QTP to record that ID (which can be done using getRoProperty) and then, on the next page, I want QTP to click on the link that has the text same as the auto-ID created in the earlier text.
Just to be more clear, here are the steps:
1) I navigate to a page in my application where an auto-ID is created…let’s say it is 3434
2) Now, I clicked on the “Save” button, then the application takes me to the next page
3) Now, a link appears with the text “3434” and I want QTP to click on the link “3434”
I have used the following code:
X= Browser().Page().WebElement().GetRoProperty(“inner text”)
Upon using the above code, it is obvious that I am getting the error “object not in repository” since I have not used something like “name:=…” for describing link object.
My question in is, in general, how do we instruct QTP to click on a link having a text that was just identified and stored as a variable.
I prefer using DP.
Re: Clicking a link having a text stored in variab