This is a migrated thread and some comments may be shown as answers.

Datadriven If Else question

5 Answers 67 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ServiceDesk
Top achievements
Rank 2
ServiceDesk asked on 29 Jul 2014, 11:17 AM
I want something simple. I have an Excel with the Question "Is the house a rental". The values can be "TRUE/FALSE". Now I have a radiobutton on the website with this question also. Now I want to know how to check the excel (datadriven) what the value is and if it's TRUE select the radiobutton "Yes" else "No".

If possible I don't want to do it in code but I can't figure out how to do it. I tried using "Verify checked is 'False' on 'RentalElement'- DataDrive: [$(RentalHouse)]" within a if else statement but I could not get it to work.

If you want a visual image of the radio question take a look here (dutch website). 
http://www.independer.nl/woonverzekering/intro.aspx

Thanks for the help!
Bjorn

5 Answers, 1 is accepted

Sort by
0
ServiceDesk
Top achievements
Rank 2
answered on 30 Jul 2014, 01:51 PM
I found the solution without using the If Else part. See the screenshot. What I do is for every radiobutton I also have an column in Excel. And yes if you put both on true in the excel the last option is selected. It work for now but its no ideal.

0
Boyan Boev
Telerik team
answered on 31 Jul 2014, 12:20 PM
Hello Roel,

Glad to hear you have found a solution.

This is the one option which is a non coded one, so I think this will work for you.

Another one is to use coded IF Else statement.

If you need further help, please let us know.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
ServiceDesk
Top achievements
Rank 2
answered on 01 Aug 2014, 06:00 AM
Boyan,

Can you also supply me with the coded if else version? Because now I have also radio buttons with 3 options: Yes, No, Don't know. And of course I can make 3 columns again in my excel but it's not bulletproof because you can make a mistake and set them all to "Yes".

Thanks,
Bjorn
0
ServiceDesk
Top achievements
Rank 2
answered on 04 Aug 2014, 06:02 AM
Boyan what I did is click during the record on both options so I have the names of the radiobutton options. Then in the code step I added this:

if(Data["GehuurdGekocht"].ToString() == "Gekocht") {
    Pages.Woonhuisverzekering0.MainContentQqControlGehuurdRadioList1Radio.Click(true);
}
else {
    Pages.Woonhuisverzekering0.MainContentQqControlGehuurdRadioList0Radio.Click(true);
}

Does this look fine? Or do I have to change things to make it more robust?

Bye,
Bjorn
0
Accepted
Boyan Boev
Telerik team
answered on 05 Aug 2014, 01:20 PM
Hi Bjorn,

It looks absolutely correct.

If you need further help, please do not hesitate to contact us again.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
ServiceDesk
Top achievements
Rank 2
Answers by
ServiceDesk
Top achievements
Rank 2
Boyan Boev
Telerik team
Share this question
or