TestStack / TestStack.Seleno

Seleno helps you write automated UI tests in the right way by implementing Page Objects and Page Components and by reading from and writing to web pages using strongly typed view models.
http://teststack.github.com/TestStack.Seleno/
MIT License
180 stars 60 forks source link

What's the syntax for Find.Element(By.jQuery(... #223

Closed RalphLavelle closed 8 years ago

RalphLavelle commented 8 years ago

return Find.Element(By.jQuery("(\''span[data-meaning=in]:contains('en'), span[data-parts=Number]:contains('2015')'').parent()\"));

I'm getting a javascript error here, but I'm not sure what exact form my jQuery should take - I've tried putting in the "$' and leaving it out. Haven't a clue!

robdmoore commented 8 years ago

Does it work with: return Find.Element(By.jQuery("span[data-meaning=in]:contains('en'), span[data-parts=Number]:contains('2015')")).FindElement(By.XPath(".."));

RalphLavelle commented 8 years ago

Yes, thanks. So I have to switch to XPath? There's no way you know of to stay within jQuery to get a parent element like that? At least I can see the syntax of the jQuery I need to use now, ta.

robdmoore commented 8 years ago

I though there would have been, but I looked through the selectors doco page and nothing jumped out at me. I could have missed it though...

On 13 Nov 2015, at 4:55 am, Ralph Lavelle notifications@github.com wrote:

Yes, thanks. So I have to switch to XPath? There's no way you know of to stay within jQuery to get a parent element like that? At least I can see the syntax of the jQuery I need to use now, ta.

— Reply to this email directly or view it on GitHub.