Micro Focus QTP (UFT) Forums
Choice in 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Choice in a WebList (/Thread-Choice-in-a-WebList)



Choice in a WebList - Still - 11-28-2008

Hello,

I am currently beginning to use QTP and am automating simple tests.
I have to do a test on a web application, where there is a WebList with several hundreds possible choices. All of them is finishing by "- Active" or "- Inactive". The test have to choose one of these choices finishing by "- Active", no matter which one exactly. The problem is that of course the texts are changing frequently from active to inactive and vice-versa, so we cannot select one precisely and hard-code it.

For the moment I though about two possible solutions (but do not know how to implement them):

1- Use a regular expression in the .Select of the WebList. I tried by using the object repository but did not find where I can do that, so I am beginning to think it is not possible.

2- Extract all the data of the WebList in a VB structure and then test each entry, until finding one which is OK and that I will use in the .Select. I do not know if it is possible and how to do it.

Can you tell me if one of these solutions is possible, and how? Or maybe tell me another better solution!

I hope I have been clear enough,

Still


RE: Choice in a WebList - Ankur - 11-28-2008

I posted a video on my blog some time back describing how to choose values from a web table in QTP


RE: Choice in a WebList - chetan-24 - 11-29-2008

Hello Ankur
i have seen that video but the solution is for webTable
now here my proble is quite same, let me explain that,

suppose i have one Listbox/DDLB in my web script that contain values like
val1
val2
val3
now with the use of script i have to found the value from that.
suppose i want to found val2.
then how it could be possible?
please Explain with Script if possible.


RE: Choice in a WebList - Still - 12-02-2008

Thank you very much Ankur, I used your video and added some stuff in my code, it worked well, it was not so complicated in fact!

Regards,
Still


RE: Choice in a WebList - Ankur - 12-02-2008

Nice to hear that Still.
Infact that is how I want people should approach any problem, instead of getting a ready-made answer they should pick up with a hint, the way you did.