lundi 16 février 2015

QTP - Clicking on a button with a given value



I've started using QTP last weekend so I'm still a bit confused about some things.

I've coded a function that opens an URL on IE, performs some actions and writes a report. But I have a little problem: at a certain point the function has to click on a button to go on but this button's value is changed at every refresh of the page.



For example: at the first access the button's value (or label) is "Results List (51)" but, if I refresh the page, the value becomes "Results List (11)".

What changes is the number inside the brackets (that identifies the number of results inside the list).



Obviously I recorded the action only one time and the result is this:

Browser("myBrowser").Page("myPage").Frame("myFrame").WebButton("Results List 51)").Click


How can I click on the button without having to worry about it's value?





Aucun commentaire:

Enregistrer un commentaire