Three filters to get object count - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Three filters to get object count (/Thread-Three-filters-to-get-object-count) |
Three filters to get object count - SBsteven - 11-05-2009 How do I use three filters to grab the count of web objects on a page? I want to get the number of objects on a page where the objects have these values: micClass = WebElement html tag = SPAN x = 180 Here is the code I have so far: ================================================= Code: 'Gather the number of filtered objects on the website. The msgbox should come back with a count of 4 instead it comes back as 93. Any ideas? SBsteven RE: Three filters to get object count - Saket - 11-05-2009 you should look in the page child objects not in the page.object also you have not serached for webElement object. try the code below Code: Set Desc = Description.Create() Sorry for the typo, Please read Number of webelements in the last statement. RE: Three filters to get object count - SBsteven - 11-05-2009 Saket, Thanks much for helping me out with this. I feel that I am much closer now. But when running your code I am getting a "General Run Error" on this line: Code: Set Doc = Browser("micClass:=Browser").Page("micClass:=Page").ChildObjects(Desc) Thanks!! SBsteven RE: Three filters to get object count - SBsteven - 11-05-2009 I finally have the answer. After posting on a few message forums and some Google searching, here is the code that works..YAY! ========================================================== Code: Dim oDesc 'Description Object SBsteven |