Passing data driven values to xpath

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
anantha.krishnan
Posts: 6
Joined: Tue Jul 09, 2013 4:23 am

Passing data driven values to xpath

Post by anantha.krishnan » Wed Jul 24, 2013 11:19 am

Hi,
I have a issue with passing data driven values to xpath's. Lets take a instance such as below

ListItem item2 = combo2.FindSingle<ListItem>("list/listitem[@accessiblename='AUSTRALIA']");

If i like to pass 'AUSTRALIA' as variable and make it as data driven. How could it be done.

Regards,
AK

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Passing data driven values to xpath

Post by Ciege » Wed Jul 24, 2013 4:05 pm

Set the variable you want then include it in the xpath...

Code: Select all

string strMyVar = "AUSTRALIA";
ListItem item2 = combo2.FindSingle<ListItem>("list/listitem[@accessiblename='" + strMyVar + "']"); 
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

anantha.krishnan
Posts: 6
Joined: Tue Jul 09, 2013 4:23 am

Re: Passing data driven values to xpath

Post by anantha.krishnan » Mon Jul 29, 2013 8:43 am

Cool. It works :)

Regards,
Anantha Krishnan.K