Select multiple check-boxes based on multiple values

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

Select multiple check-boxes based on multiple values

Post by varun » Wed Feb 13, 2013 2:01 pm

Hi Support,

In an application, I need to select multiple check-boxes on the basis of multiple values provided in cell of excel, split-ted by comma. I have applied following code snippet-

Code: Select all

string source = VarKeepCurrAuth_CheckBox;
string[] vals = source.Split(',');
InputTag chkoptions;
foreach(string val in vals)
{
Host.Local.TryFindSingle("/dom[@caption='Analyst Worksheet']//table[#'dgDataGrid']//td[@innertext='"+val+"'/../td[27]//input]", out chkoptions);
chkoptions.Click();
}
But it's giving error as in attached "RXError_SelectMultipleCheckbox.png" screenshot.

FYI, I have also attached RX snapshot of the grid. Please review that and let me know where I am wrong and what needs to be done for this ? I have to select some check-boxes from last column of grid.

Thanks in advance,
Varun.
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Select multiple check-boxes based on multiple values

Post by Support Team » Thu Feb 14, 2013 12:49 pm

If you look closely at your RanoreXPath, it is missing a closing bracket "]" after the innertext value.

Regards,
Alex
Ranorex Team

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

Re: Select multiple check-boxes based on multiple values

Post by varun » Thu Feb 14, 2013 2:06 pm

Hi Alex,

Yes, that was my mistake but even after applying bracket, same error is appearing. PFA screenshot from RX Log.

Looking forward for its solution.

Regards,
Varun.
You do not have the required permissions to view the files attached to this post.

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

Re: Select multiple check-boxes based on multiple values

Post by varun » Mon Feb 18, 2013 8:45 am

Hi Support,

Can you please provide me solution of mentioned problem?

Regards,
Varun.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Select multiple check-boxes based on multiple values

Post by Support Team » Mon Feb 18, 2013 9:44 am

Again, just take a closer look at the RanoreXPath you posted, there's another single dangling bracket. The exception message even tells you the exact character index (89)...

Regards,
Alex
Ranorex Team