Micro Focus QTP (UFT) Forums
Unable to print a text present within a weblist - 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 Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: Unable to print a text present within a weblist (/Thread-Unable-to-print-a-text-present-within-a-weblist)



Unable to print a text present within a weblist - rajpradeep32 - 06-16-2015

Code:
SystemUtil.Run "iexplore.exe", "https://developer.salesforce.com/signup?d=70130000000td6N"

'Trying to get the weblist count, am able to do it successfully
Code:
Set obj=Description.Create
obj("micclass").value="WebList"
Set odef=Browser("name:=Salesforce Developers").Page("title:=Salesforce Developers").ChildObjects(obj)
Print odef.Count

'Unable to print the text name present within the Weblist

Code:
Set oabc=Browser("name:=Salesforce Developers").Page("title:=Salesforce Developers").WebList("user[country]").GetItem(2)
Msgbox oabc



RE: Unable to print a text present within a weblist - akhi_s27 - 08-03-2015

WebList("user[country]") - This seems to be an object from the repository.
You cannot use Descriptive programming in this order.
1. If Parent object is identified by descriptive methods, the child objects also need to be identified by descriptive methods only.
2. If parent object identified by Object repository, the child objects could be descriptive.

In short, once you use descriptive technique for a statement, all the subsequent object references in it need to be descriptive.

In your case you could use
Code:
odef(0).GetItem(2)
here '0' could be replaced by whatever index of the weblist you wish to interact with.


RE: Unable to print a text present within a weblist - QTP.learning - 08-09-2015

is WebList("user[country]") is name of object ? if not can you try with backslash I.E WebList("user\[country\]")

Thanks
Bharadwaj


RE: Unable to print a text present within a weblist - ADITI1992 - 08-26-2015

Run this:

Code:
SystemUtil.Run "iexplore.exe", "https://developer.salesforce.com/signup?d=70130000000td6N"
Set obj=Description.Create
obj("micclass").value="WebList"
Set odef=Browser("name:=Salesforce Developers").Page("title:=Salesforce Developers").ChildObjects(obj)
Print odef.Count
For i=1 to 231
oabc=Browser("name:=Salesforce Developers").Page("title:=Salesforce Developers").WebList("html id:=country","html tag:=SELECT").GetItem(i)
Print oabc
Next