Micro Focus QTP (UFT) Forums
Weblist selection - 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: Weblist selection (/Thread-Weblist-selection)

Pages: 1 2


Weblist selection - diya - 11-20-2012

Code:
browser("").Page("").weblist("customertype").
here i do have two customer types wholesaler and retailer. both have different steps and if i want to give if else condition here.
Code:
if customertype =wholesaler then do these steps
steps.............
else
these steps
steps.............
how can i give these steps please let me know
thanks

I tried this but not able to get
Code:
r=browser("").Page("").Weblist("customertype").GetROProperty("text")
if cutomertype=r
steps

else

steps

end if



RE: Weblist selection - ManualTester - 11-20-2012

Hi there,
Try this,

Code:
Browser("..").Page("..").WebList("customertype").GetItem(1)
Set appropriate index for the customer from the Web List. And also I would look if the returned property from GetROProperty("text") is the right customer.

Thanks,


RE: Weblist selection - diya - 11-21-2012

Hello iam new to QTP trying out ,sorry but i did not understand your solution as what to do...please can you do it in detail and how to do that index please explain


RE: Weblist selection - ManualTester - 11-21-2012

Please post your QTP script.


RE: Weblist selection - diya - 11-21-2012

Hello,

I have posted what i was trying in my question.if thats wrong i donno how to proceed so seeking help


RE: Weblist selection - ManualTester - 11-21-2012

What do you get when your try to execute these two line.
Code:
r=browser("").Page("").Weblist("customertype").GetROProperty("text")
Msgbox r



RE: Weblist selection - kalaivanan123 - 11-21-2012

Try the below one,

Code:
Browser("").Page("").Weblist("customertype").Select Randomnumber(0,1)      'If you are having 2 dropdown value,QTP will select random one from that two value

wait 1

r=browser("").Page("").Weblist("customertype").GetROProperty("value")
if r="wholesaler" Then

steps

elseIf r="retailer"

steps

end if



RE: Weblist selection - diya - 11-21-2012

HELLO kalaivanna,

GOT it !!!!!!!!!!!!!!!!!!!!!

Thank you


RE: Weblist selection - ManualTester - 11-21-2012

kalaivanna,

Good job.


RE: Weblist selection - imzeeshan - 11-22-2012

You are using 'GetROProperty("text")' when instead to get the current selected item in any list box you should use 'GetROProperty("value") or GetROProperty("selected").