How to select a value in select element found by XPath?

213 views
Skip to first unread message

Igor

unread,
Jul 17, 2014, 2:54:00 AM7/17/14
to co...@googlegroups.com, igo...@qualisystems.com
Hi everyone,

I found the only way to set a value in select element: BrowserSession.Select(name).From("select-id");
The element is found by its id.

Is there any way to find it by XPath? For example: BrowserSession.Select(name).From("//[@custom-attribute='model-selector']");

Thank you for advance,
Igor

Adrian Longley

unread,
Jul 17, 2014, 3:10:23 AM7/17/14
to co...@googlegroups.com
Yes:

BrowserSession.FindXPath("//select[@custom-attribute='model-selector']").SelectOption(name);

Probably worth adding select to the XPath like that too or its gonna check attributes on every element in the document.

Thank you for advance,
Igor

--
You received this message because you are subscribed to the Google Groups "Coypu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coypu+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages