'I am unable to click on any element which is inside a frame tag in Test Cafe
I am able to login to my application but after that unable to perform any action because all elements are inside the frame tag. The approaches I have tried:
- Selector(() =>{return document.getElementById("frameId").contentDocument.getElementById("#ele")});
- t.switchTo("frameID"); var ele = Selector("#ele"); await t.click(ele);
- browser.switchToFrame('#outerFrame');
- const y=await ClientFunction(() => window.location.pathname)() await t.switchToWindow(f => f.url.pathname === y)
please do let us know any workaround to access the element inside the frame tag
Solution 1:[1]
The correct way to click an element inside an iframe is to use the switchToIframe
function. Please refer to the following article for more details: https://testcafe.io/documentation/402681/reference/test-api/testcontroller/switchtoiframe
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Alex Kamaev |