以下是我在 IE 中使用的代码的语法:
driver.findElement(By.cssSelector("#loginForm>div>table>tbody>tr:nth-child(4)>div>span>span>span")
错误是:
org.openqa.selenium.NoSuchElementException: Unable to find element with css selector == #loginForm>div>table>tbody>tr:nth-child(4)>div>span>span>span (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 594 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.31.0', revision: '1bd294d', time: '2013-02-27 20:53:56'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_17'
Session ID: f0058b48-ac08-4623-9920-5a871ce43605
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{platform=WINDOWS, elementScrollBehavior=0, javascriptEnabled=true, enablePersistentHover=true, ignoreZoomSetting=false, browserName=internet explorer, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss, version=8, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, allowAsynchronousJavaScript=true, requireWindowFocus=false, handlesAlerts=true, initialBrowserUrl=, nativeEvents=true, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
有人可以帮忙吗?