因此,以我的燈箱公認的,我如何訪問它的內部?如何在水燈箱/ fancybox中找到項目與水豚
當我鍵入:
within("div.fancybox-wrap.fancybox-desktop.fancybox-type-iframe.fancybox-opened") do
within(:xpath, "//table[@id='small_calendar'][0]") do
page.find('td', :text => '5').click
end
end
對於
<table id="small_calendar">
我得到...
Unable to find xpath "//table[@id='small_calendar'][0]" (Capybara::Element
NotFound)
修改搜索....
sleep(10)
within("div.fancybox-wrap.fancybox-desktop.fancybox-type-iframe.fancybox-opened") do
within_frame('fancybox-frame') do
#within(:xpath, ".//table[@id='small_calendar'][0]") do
page.find(:xpath, ".//table[@id='small_calendar'][0]/td[@text='5']").click
#end
end
end
讓我這個錯誤...
findElements execution failed;
Element does not exist in cache (Selenium::WebDriver::Error::StaleElement
ReferenceError)
請問您可以添加頁面的html - 頁面和iframe? –