Page 1 of 1

Want to drive Radio and Checkbox options w.r.t data in Excel

Posted: Fri Sep 28, 2012 1:10 pm
by varun
Hi Support,

In my application, we have 2 Radio options(say A & B) which are disabled by default but only gets enable if a check box say "CB1" is selected. By default, Radio "A" is selected from 2 radio options. I have recorded a scenario in which I manually select "B" radio option.
And now want it data driven with source from Excel file. But on executing test result, RX unable to drive radio buttons as per data in Excel. I am following steps as per Ranorex Tutorial, Please check page 15 of this document, I am not getting this window on my side. Could you please help to fix this problem?
Attached is the snapshot of RX Path Editor appearing at my end.

Also, please let me know how can I de-select the selected check-box through Data Driven.

Thanks and Regards,
Varun.

Re: Want to drive Radio and Checkbox options w.r.t data in Excel

Posted: Mon Oct 01, 2012 10:57 am
by Support Team
Hi,

You can for instance check in UserCode if the value of a variable (which was set via the data connector) is set to a specific value, and if it is set to the value you have to perform a specific action, like clicking on the RadioButton A.

Regards,
Markus
Ranorex Support Team

Re: Want to drive Radio and Checkbox options w.r.t data in Excel

Posted: Wed Oct 03, 2012 5:28 am
by varun
Hi Markus,

Thanks for your feedback!
Is this the only solution for this problem as I think there could be another way also to achieve this. As I have only to make Radio buttons Data driven.
Please clarify.

Thanks & Regards,
Varun.

Re: Want to drive Radio and Checkbox options w.r.t data in Excel

Posted: Thu Oct 04, 2012 5:12 am
by varun
Hi Markus,

Please review the following code snippet I am executing, as per your previous reply. Still RX not working for Radio options and throwing 2 errors as in attached snapshot.


public void Mouse_Click_RblIsConstrained()
{
if(VarIsConstrained.Length > 0) // Check to verify whether value of variable is available in data source
{
if(VarIsConstrained == "Primary") // Check to verify value of variable(which was set via the data connector) is set to a specific value
{
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'MaintainResource.Primary' at 22;6.", repo.MaintainResource.PrimaryInfo);
repo.MaintainResource.Primary.Click("22;6"); // Performing specific action(mouse click on first radio option)

}
else
{
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'MaintainResource.RblIsConstrained' at 9;11.", repo.MaintainResource.RblIsConstrainedInfo);
repo.MaintainResource.RblIsConstrained.Click("9;11"); // Performing specific action(mouse click on second radio option)
}
return;
}

}


Please provide me with fix details for both errors and guidance from you. Let me know if any thing need to change in code or logic.

Thanks & Regards,
Varun.

Re: Want to drive Radio and Checkbox options w.r.t data in Excel

Posted: Thu Oct 04, 2012 12:49 pm
by varun
Hi Support,

I am done with this Issue. Thanks for your kind support :!:

Regards,
Varun.

Re: Want to drive Radio and Checkbox options w.r.t data in Excel

Posted: Thu Oct 04, 2012 1:48 pm
by Support Team
Hi,

I am glad you were able to solve the issue!

Regards,
Markus
Ranorex Support Team