Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Monday 29 May 2017


How to get the collection of all TD (table data cells) elements of the table using HTML DOM in QTP?


Set tdtags =Browser(“Browser”).Page(“Page”).WebTable("mytable").Object.getElementsByTagName("TD")


How to get the collection of all TH (table header cells) elements of the table using HTML DOM in QTP?


set thtags = Browser(“Browser”).Page(“Page”).WebTable("mytable").Object.getElementsByTagName("TH")


How to get the value of attribute of any element using HTML DOM in QTP?

Set myobj = Browser(“Browser”).Page(“Page”).WebTable("mytable").Object
Print myobj.getAttribute("class"'This will print the value of class attribute of myobj - table 


How to get the collection of all table rows using HTML DOM in QTP?

Set tableObj =Browser(“abc”).Page(“mypage”).WebTable("mytable").Object
Set trtags = tableObj.getElementsByTagName("tr")

How to find the total number of rows in table Using HTML DOM in QTP?


print trtags.length


How to get the value inside table cell Using HTML DOM in QTP?

Set tdtags =Browser(“abc”).Page(“mypage”).WebTable("mytable").Object.getElementsByTagName("TD")
Print tdtags(0).innerText 'print the text displayed inside first td tag in table


No comments:

Post a Comment

Note: only a member of this blog may post a comment.