Kir*_*Kir 1 c# selenium webdriver css-selectors
我正在尝试使用CssSelector在我的网页上找到一个元素.我正在使用Firefox驱动程序.
这是我使用定位器的方式(我检查过Selenium IDE能够找到我的元素
[FindsBy(How = How.CssSelector, Using = "label:contains('Version: 2.0.')")]
public IWebElement labelVersion;
Run Code Online (Sandbox Code Playgroud)
但是当在C#代码中使用它并在我的构造函数中使用PageFactory.InitElements初始化它时.
我遇到了这个错误...(错误本身很清楚,但我不知道如何解决它)
感谢任何输入.
OPC.Tests.SmokeTest(TestFixtureSetUp):设置:OpenQA.Selenium.InvalidSelectorException:给定的选择的CSS =标签:含有( '版本:2.0')是无效或不导致WebElement.出现以下错误:[异常..."无效或非法字符串指定"代码:"12" nsresult:"0x8053000c(NS_ERROR_DOM_SYNTAX_ERR)"的位置:"文件:/// .......... /anonymous439571104.webdriver-profile/extensions/fxdriver@googlecode.com/components/driver_component.js行:5811"]