![]() |
Need help to improve the statement - 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: Need help to improve the statement (/Thread-Need-help-to-improve-the-statement) |
Need help to improve the statement - yngielkoh - 10-05-2016 The statement below work only if there are several items in the Installed Assets applet but if there is only one item it will not work. Is there a way to improve the statement below? Also if there are several items in the list and you need to scroll down and the item you were looking for will be seen once you scroll down it will also cause an error. Please help. Dim objProduct Dim intLoopCounter Dim intLoopCounter2 Dim objProduct intLoopCounter = 0 intLoopCounter2 = 0 Do Until objProduct = strInstalledAssets objProduct = SiebApplication("Siebel Communications").SiebScreen("Accounts").SiebView("Account Summary").SiebApplet("Installed Assets").SiebList("List").SiebText("Product").GetROProperty("text") DataTable.Value("data", dtLocalSheet) = objProduct intLoopCounter = intLoopCounter + 1 SiebApplication("Siebel Communications").SiebScreen("Accounts").SiebView("Account Summary").SiebApplet("Installed Assets").SiebList("List").ActivateRow intLoopCounter Loop intLoopCounter2 = intLoopCounter - 1 SiebApplication("Siebel Communications").SiebScreen("Accounts").SiebView("Account Summary").SiebApplet("Installed Assets").SiebList("List").ActivateRow intLoopCounter2 |