Verifying the contents of a Web List in QTP scipt - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others) +--- Thread: Verifying the contents of a Web List in QTP scipt (/Thread-Verifying-the-contents-of-a-Web-List-in-QTP-scipt) |
Verifying the contents of a Web List in QTP scipt - ritugoyal - 01-11-2010 Hi All, Please can any body tell me the code in QTP(vb script) to verify the items of a Web List. e.g. If I need to select ABC items in Web List and before selecting that item I want to verify that whether that item exist in Web List or not. Regards, Ritu RE: Verifying the contents of a Web List in QTP scipt - malleshjm - 01-29-2010 Code: listval = browser("name").Page("name).WebList("name").GetROProperty("all items") use this aray and check whether ur item is thr in the list or not Correct if m wrong. even i am new to QTP. Regards, Mallesh RE: Verifying the contents of a Web List in QTP scipt - sreekanth chilam - 01-29-2010 Hi , Use the below code. Code: Expected_Item="ABC" RE: Verifying the contents of a Web List in QTP scipt - moon_walker333 - 01-03-2013 You could simply do something like this: Code: vendorListItems = Browser("...").Page("...").WebList("...").GetROProperty("all items") RE: Verifying the contents of a Web List in QTP scipt - Vijay Kumar - 10-07-2016 ExpectedResult="Sales" ItemCount=Browser("OrangeHRM").Page("OrangeHRM_2").WebList("leaveList[cmbSubunit]").GetROProperty("all items") itensplit=split(ItemCount,";") For i = 1 To UBound(itensplit) Step 1 actualResult=Browser("OrangeHRM").Page("OrangeHRM_2").WebList("leaveList[cmbSubunit]").GetItem(2) If actualResult=ExpectedResult Then MsgBox "Elemet Found" Browser("OrangeHRM").Page("OrangeHRM_2").WebList("leaveList[cmbSubunit]").Select "Sales" Exit for End If Next |