Select multiple check-boxes based on multiple values

Ranorex Spy, Recorder, and Studio.
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.
Attachments
MultipleCheckboxSelection.rxsnp
CheckboxGrid
(721.08 KiB) Downloaded 177 times
RXError_SelectMultipleCheckbox.png
RXError_SelectMultipleCheckbox
RXError_SelectMultipleCheckbox.png (8.81 KiB) Viewed 838 times

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

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

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.
Attachments
MultipleCheckboxSelection_0214.png
MultipleCheckboxSelection_0214.png (7.95 KiB) Viewed 817 times

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: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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