tcl-selenium webdriver:复合 xpath 搜索失败
tcl-selenium webdriver: Composite xpath search fails
我在创建包含调用的复合 xpath 时遇到困难。
但是将它们分开效果很好。
什么不工作:
$window element by_xpath {//div[@class="frost-application-bar "]/*[text()[contains(., "Network")]}
和
$window element by_xpath {//div[@class="frost-application-bar "]//*[text()[contains(., "Network")]}
>set token [eval "::http::geturl http://127.0.0.1:4444/wd/hub/session/1aaacf7a-460e-4042-9898-722402b5ef76/window -type application/json -query {{ "name": "CDwindow-70BE1451-D49B-4D23-B853-7EA9A48C3167" }}"]
>set token [eval "::http::geturl http://127.0.0.1:4444/wd/hub/session/1aaacf7a-460e-4042-9898-722402b5ef76/window_handle -type application/json "]
>set token [eval "::http::geturl http://127.0.0.1:4444/wd/hub/session/1aaacf7a-460e-4042-9898-722402b5ef76/element -type application/json -query {{ "using": "xpath", "value": "//div[@class=\"frost-application-bar \"]//*[text()[contains(., \"Network\")]" }}"]
>::invalidSelectorError19
什么工作
$window element by_xpath {//div[@class="frost-application-bar "]}
::WebDriver::Session::webElement211 descendant by_xpath {//*[text()[contains(., "Network")]]}
::WebDriver::Session::webElement212 click
末尾的方括号不匹配。应该是:
$window element by_xpath {//div[@class="frost-application-bar "]/*[text()[contains(., "Network")]]}
我在创建包含调用的复合 xpath 时遇到困难。 但是将它们分开效果很好。
什么不工作:
$window element by_xpath {//div[@class="frost-application-bar "]/*[text()[contains(., "Network")]}
和
$window element by_xpath {//div[@class="frost-application-bar "]//*[text()[contains(., "Network")]}
>set token [eval "::http::geturl http://127.0.0.1:4444/wd/hub/session/1aaacf7a-460e-4042-9898-722402b5ef76/window -type application/json -query {{ "name": "CDwindow-70BE1451-D49B-4D23-B853-7EA9A48C3167" }}"]
>set token [eval "::http::geturl http://127.0.0.1:4444/wd/hub/session/1aaacf7a-460e-4042-9898-722402b5ef76/window_handle -type application/json "]
>set token [eval "::http::geturl http://127.0.0.1:4444/wd/hub/session/1aaacf7a-460e-4042-9898-722402b5ef76/element -type application/json -query {{ "using": "xpath", "value": "//div[@class=\"frost-application-bar \"]//*[text()[contains(., \"Network\")]" }}"]
>::invalidSelectorError19
什么工作
$window element by_xpath {//div[@class="frost-application-bar "]}
::WebDriver::Session::webElement211 descendant by_xpath {//*[text()[contains(., "Network")]]}
::WebDriver::Session::webElement212 click
末尾的方括号不匹配。应该是:
$window element by_xpath {//div[@class="frost-application-bar "]/*[text()[contains(., "Network")]]}