taiko
taiko copied to clipboard
Facing issue while accessing elements within Iframe
We are testing an UI app (Technology - Angular) which has "Iframe" elements. There is a #document(html ->body-.>div->input) structure inside the Iframe . We need to access the textbox elements inside the html structure within the Iframe. These elements are not located when we tried to access it using taiko (used different locators such as visible text, Id , relative & full xpath). Please help us resolving this issue. taiko version is 1.3.2.
Have you tried the $
selector? You can pass it a function that uses the native DOM api.
What I would try is to pass in a function that uses document.querySelector("iframe").contentDocument.querySelector("input[type='text']")
to get a handle on an element within an iframe and try manipulating that?
@selvaganesan2005 I was facing the same issue a while ago. I could just solve this issue by running the tests in headless mode in which I had no problems accessing elements inside an iframe. But we could not solve the issue to access the elements in headful mode.