So with my lightbox recognized, how do I access what is inside of it?
When I type:
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
For
<table id="small_calendar">
I get…
Unable to find xpath "//table[@id='small_calendar'][0]" (Capybara::Element
NotFound)
Modified search….
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
gets me this bug…
findElements execution failed;
Element does not exist in cache (Selenium::WebDriver::Error::StaleElement
ReferenceError)
Got it!
The problem seems to be that within-frame and xpath do not get along. Once I removed it from the equation, I got the desired result.