我在这里是新的,甚至到Ruby
和Selenium
。我试图点击以下代码的网页上的链接:无法点击链接使用链接文本/部分链接文字使用红宝石
<a> target="mainFrame" href="dynamic_Utility_Index.htm">Dynamic Utilities</a>
所以基本上我想点击这个动态工具。这是我迄今编写的脚本是:
require 'selenium-webdriver'
require 'win32ole'
driver = Selenium::WebDriver.for:firefox
driver.manage().window().maximize();
driver.navigate.to 'xyz.com'
wait = Selenium::WebDriver::Wait.new(:timeout =>10) # seconds
#Click on Dynamic Utilities
wait.until{driver.find_element(:link_text,'dynamic_Utility_Index.htm').click}
puts "Clicked"
我甚至使用环节,partial_link_text到位LINK_TEXT,但不断收到以下错误
(Unable to locate element: {"method":"link text","selector":"dynamic"}) (Selenium::WebDriver::Error::TimeOutError)
我使用Ruby
和Selenium Web driver
。
您可以检查此链接位于一个iframe里面?谢谢。 – alecxe
没有它在iframe中没有内涵 –