FindAllCss/CSS Selector - driving me nuts!

76 views
Skip to first unread message

CJ Harrison

unread,
Dec 29, 2015, 6:01:53 AM12/29/15
to Coypu
Hi there,

I have a webpage where I am finding an element using a CSS selector. If I do this then I'm good:-


var button = _browser.FindAllCss("button.btn-default[ng-click]").Where(b => b["ng-click"] == "submitForm('login')");

but if I try:-

_browser.FindAllCss("button.btn-default[ng-click='submitForm('login')']")

Then the call fails with illegal CSS Selector...

Any ideas? Is driving me nuts :-)



CJ Harrison

unread,
Dec 30, 2015, 9:10:09 AM12/30/15
to Coypu
Found out what it was - it's the ' characters in my CSS selector string that were giving me the illegal selector message - you have to double backslash them

This works:-

_browser.FindAllCss("button.btn-default[ng-click='submitForm(\\'login\\')']")
Reply all
Reply to author
Forward
0 new messages