I'm developing an atomation test using Capybara and Ruby. I need to switch frame to acess the webelement in the Report page, but I don't know how can I do it.
HTML code:
<iframe name="OF_jreport" id="OF_jreport" width="100%" height="100%" frameborder="0" border="0"></iframe>
I'm trying it:
def check_supplier_report()
sleep 10
@session.switch_to_frame("//*[@id=\"OF_jreport\"]")
teste = @session.find("//*[@id=\"GTC_CODE\"]").text
puts teste
end
But on console it is return the follow error:
You must provide a frame element, :parent, or :top when calling switch_to_frame (ArgumentError) ./features/helpers/commons.rb:158:in `check_supplier_report'
Can someone help me? Thanks