c# - OPC.Tests.SmokeTest (TestFixtureSetUp): SetUp : OpenQA.Selenium.InvalidSelectorException -
i trying use cssselector locate element on webpage. using firefox driver.
here how using locator (i checked selenium ide able locate element this
[findsby(how = how.cssselector, using = "label:contains('version: 2.0.')")] public iwebelement labelversion;
but when use in c# code , initialize pagefactory.initelements in constructor.
i hit error... (the error pretty clear don't know how fix it)
appreciate inputs.
opc.tests.smoketest (testfixturesetup): setup : openqa.selenium.invalidselectorexception : given selector css=label:contains('version: 2.0.') either invalid or not result in webelement. following error occurred: [exception... "an invalid or illegal string specified" code: "12" nsresult: "0x8053000c (ns_error_dom_syntax_err)" location: "file:///........../anonymous439571104.webdriver-profile/extensions/fxdriver@googlecode.com/components/driver_component.js line: 5811"]
selenium delegates css queries down browser. means css queries need follow css standard.
unfortunately :contains removed standard while back. recommend redo selector whats available spec or use xpath.
:contains works in selenium rc because rc uses sizzle, selector search library in jquery if wondering why works in rc , not webdriver
Comments
Post a Comment