是否有任何tcl等价物:
driver.find_elements_by_xpath("//*[contains(text(), 'Lookup Network Elements')]")?
我正在尝试运行类似:
set networkButton [$window element by_xpath "//*\[@class=\"frost-button\"\]//div\[contains(\"Network\")\]"]
但它给了我错误
::invalidSelectorError10
答案 0 :(得分:4)
你的contains()是错误的,它不是在寻找text()元素。你需要写一些类似的东西:
set networkButton [$window element by_xpath "//*\[@class=\"frost-button\"\]//div\[contains(text(), \"Network\")\]"]
或
set networkButton [$window element by_xpath "//*\[@class=\"frost-button\"\]//div\[text()\[contains(., \"Network\")\]\]"]