繁体   English   中英

木偶页面。单击(选择器)不响应iframe

[英]Puppeteer page.click(selector) not responding for IFrames

 await page.evaluate(() => { window.scrollBy(0, window.innerHeight); }) jest.setTimeout(20000) await page.click('#ApplyBthNAP, #btnCheck'); 
 <iframe id="frameContent" frameborder="0" height="100%" marginheight="0" marginwidth="0" scrolling="no" width="100%" src="html/status/wlaninfo.asp" style="height: 585px;"></iframe> <div id="ApplyBthNAP"> <span class="tabal_head"> <script> document.write(status_wlaninfo_language['amp_napinfo_title']); </script> Neighboring AP Information </span> <input style="margin-left:25px;" name="btnCheck" class="submit" id="btnCheck" type="button" value="Query"> <script> document.getElementsByName('btnCheck')[1].value = status_wlaninfo_language['amp_stainfo_query']; </script> </div> 

我不断收到的错误是FAIL test \\ header.test.js(24.613s)×单击并检查url(23238ms)

●点击并检查网址

TypeError: Cannot read property 'click' of null

  at Page.click (node_modules/puppeteer/lib/Page.js:816:18)

console.assert node_modules \\ puppeteer \\ lib \\ Page.js:815 AssertionError [ERR_ASSERTION]:找不到用于选择器的节点:#ApplyBthNAP,#btnCheck

测试套件:1个失败,总共1个

经过一些研究,我知道木偶有一些与IFrames相关的错误。 要求是使用Value ='Query'按下按钮。普通选择器方法唯一的问题是显示为空。 请赐教。 提前致谢

也许您是说('#ApplyBthNAP #btnCheck')而不是('#ApplyBthNAP, #btnCheck') div中查找按钮,而不是按钮 div?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM