我无法单击测试咖啡厅中帧标签中的任何元素

发布于 2025-01-24 17:11:47 字数 471 浏览 5 评论 0原文

我可以登录到我的应用程序,但是在此之后,由于所有元素都在帧标签内部,因此无法执行任何操作。 我尝试过的方法:

  1. selector(()=> {返回 document.getElementById(“ frameId”)。contentDocument.getElementById(“#ele”)});
  2. T.Switchto(“ frameid”); var ele = selector(“#ele”); 等待T.Click(Ele);
  3. browser.switchtoframe('#outerframe');
  4. const y =等待客户端功能(()=> window.location.pathname)()() 等待T.Switchtowindow(f => f.url.pathname === y)

请让我们知道任何解决方法以访问框架标签内的元素

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暖心男生 2025-01-31 17:11:48

单击iframe内部元素的正确方法是使用switchtoiframe函数。请参阅以下文章以获取更多详细信息: https:// testcafe。 io/documentation/402681/reference/test-api/testController/switchtoframe

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文