Page 1 of 1

Select multiple check-boxes based on multiple values

Posted: Wed Feb 13, 2013 2:01 pm
by varun
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.

Re: Select multiple check-boxes based on multiple values

Posted: Thu Feb 14, 2013 12:49 pm
by Support Team
If you look closely at your RanoreXPath, it is missing a closing bracket "]" after the innertext value.

Regards,
Alex
Ranorex Team

Re: Select multiple check-boxes based on multiple values

Posted: Thu Feb 14, 2013 2:06 pm
by varun
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.

Re: Select multiple check-boxes based on multiple values

Posted: Mon Feb 18, 2013 8:45 am
by varun
Hi Support,

Can you please provide me solution of mentioned problem?

Regards,
Varun.

Re: Select multiple check-boxes based on multiple values

Posted: Mon Feb 18, 2013 9:44 am
by Support Team
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