automated tests - QTP - getting value of element -


I am starting with QTP and can not figure out how to get value of an element. For example, when I just want to compare the number of results met by Google I tried to select an element with object detective and value in the variable to use the value ... but this does not work. Can anyone help with this? BTW, I'm not sure it is right to choose the text to compare with Object Detective. Thanks!

You should use GetROProperty to get the text and then use the value Pars this for.

By viewing a Google results page, I think the result 3 is in a paragraph with bold code in the id = resultStats .

  & lt; P id = "resultStats" & gt; Results & lt; B & gt; 1 & lt; / B & gt; - & lt; B & gt; 10 & lt; / B & gt; About & lt; B & gt; 2,920,000 & lt; / B & gt; & Lt; B & gt; Qtp & lt; / B & gt; for. (& Lt; b & gt; 0.22 & lt; / b & gt; seconds) & lt; / P & gt;  

Then the following script number (with comma as a string) becomes.

  Browser ("micclass: = Browser"). Page ("micclass:" page = "". = "". "(" Html id: = resultStats ") .WebElement (" html tag: = b "," index: = 2 "). GetROProperty (" innertext ")  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -