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

Ranorex Spy, Recorder, and Studio.
varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

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

Post by varun » Fri Sep 28, 2012 1:10 pm

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.
Attachments
Radio1.png
RXPathEditor
Radio1.png (98.22 KiB) Viewed 1349 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Mon Oct 01, 2012 10:57 am

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
.
Image

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

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

Post by varun » Wed Oct 03, 2012 5:28 am

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.

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

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

Post by varun » Thu Oct 04, 2012 5:12 am

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.
Attachments
Error_AddResource.png
Errors
Error_AddResource.png (106.28 KiB) Viewed 1325 times

varun
Posts: 110
Joined: Mon Jul 23, 2012 5:52 am

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

Post by varun » Thu Oct 04, 2012 12:49 pm

Hi Support,

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

Regards,
Varun.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Thu Oct 04, 2012 1:48 pm

Hi,

I am glad you were able to solve the issue!

Regards,
Markus
Ranorex Support Team
.
Image