Micro Focus QTP (UFT) Forums
How to skip a step - 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: How to skip a step (/Thread-How-to-skip-a-step)



How to skip a step - sudhirzpatil - 01-29-2009

how to skip a step in QTP.
I am parameterizing Radio button. In that application by default first Radio button is selected.( Economy button is selected by default)
In the Global table i put the values of button as

1 Business
2 Economy
3 First.
Here after parameterizing the test it works well for first and third iteration.
But for second iteration as it is already selected it gives error.
I want to avoid the following step for second iteration because the radio button is already selected.

Code:
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebRadioGroup("servClass").Select DataTable("p_Value", dtGlobalSheet)



RE: How to skip a step - manojith1984 - 01-29-2009

Hi Sudhir,
I hope in the RO Property "value" would help you. Check for the "value" property which,
when the first RadioButton in the group is selected, returns "#1"
when the Second RadioButton in the group is selected returns "#2"
when the first ThirdButton in the group is selected returns "#3"

Hence before going and selecting the particular webradiogroup get the ROProperty and go ahead.
i.e
Code:
If Not Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebRadioGroup("servClass").GetROProperty("value") = "#1" and Datatable.GetSheet("Global").GetParamenter("p_Value").Value = "Business"
then

Code:
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebRadioGroup("servClass").Select DataTable("p_Value", dtGlobalSheet)

........

Hope this would help in solving the error.


RE: How to skip a step - sreekanth chilam - 01-29-2009

Hi Manoj,

I hope its a very lengthy way.

Just try out this way :


Code:
if (DataTable("p_Value", dtGlobalSheet)<>"Economy") then
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebRadioGroup("servClass").Select DataTable("p_Value", dtGlobalSheet)
  End if

Here if datatable value is not equal to "Economy" then it will take the value from datatable & select the radiobutton.
If datatable value is equal to "Economy" , it will not enter the " if " loop at all & continues with the next executable statements....so like this we have skipped the second step.

I hope you understood the solution...


RE: How to skip a step - sudhirzpatil - 01-30-2009

Hi Shrekanth and Manoj,

Thanks a lot , both of your steps works.

I also need a hlep of a thread i posted as " Parameterization under parameterization"

Hope you guys help in in this regards.


RE: How to skip a step - manojith1984 - 01-30-2009

Hi Sudhir,
I think using global and local sheet would solve the issue of "Parameterization under parameterization". If you are expecting anything else please do explain the scenario where and when is it required


RE: How to skip a step - sudhirzpatil - 01-30-2009

Hi Manojith,
just take a example of Flight Reservation application.

In this first login with any user. Under this login parameterize the test for no of Flights dates.

Same test i want to run for multiple Login user.

Thanks in advance