'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:

  1. Selector(() =>{return document.getElementById("frameId").contentDocument.getElementById("#ele")});
  2. t.switchTo("frameID"); var ele = Selector("#ele"); await t.click(ele);
  3. browser.switchToFrame('#outerFrame');
  4. 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