Fill input in .mhtml file opened in Browser

回眸只為那壹抹淺笑 提交于 2020-05-16 22:30:34

问题


I want to run e2e tests on mhtml files, i.e., fill out a form.

Viewing and extracting data works really well on the mhtml file, but I cannot fill out any input fields (neither manually nor via puppeteer). You can try it out with this mhtml file I created from the StackOverflow login page.

<input name="firstName" value="">

This is how I open the snapshot:

browser = await puppeteer.launch()
page = await browser.newPage()
const snapshotPath = join('file://', __dirname, 'mysnapshot.mhtml')
await page.goto(snapshotPath)

Is there a way to fill in inputs in mhtml files or is it only possible to view them in Chrome?

Converting the snapshot to HTML works, but I want to avoid that if possible.

来源:https://stackoverflow.com/questions/61800030/fill-input-in-mhtml-file-opened-in-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!