Selenium WebdriverIO:执行上下文在分离的框架中不可用
我正在尝试自动化一个流程,在过去的三年中,我每天至少做一次。这是一个不必要的复杂过程,占用了我一天的时间。这是一个内部专有系统,所以我不能给你任何关于它的细节,但足以说,我不能改变它。我必须尝试按原样自动化它,我遇到了以下错误:Selenium WebdriverIO:执行上下文在分离的框架中不可用,selenium,google-chrome,automation,puppeteer,webdriver-io,Selenium,Google Chrome,Automation,Puppeteer,Webdriver Io,我正在尝试自动化一个流程,在过去的三年中,我每天至少做一次。这是一个不必要的复杂过程,占用了我一天的时间。这是一个内部专有系统,所以我不能给你任何关于它的细节,但足以说,我不能改变它。我必须尝试按原样自动化它,我遇到了以下错误: Execution context is not available in detached frame "https://..." (are you trying to evaluate?) 我使用WebDrivero的默认配置是在内部使用Pup
Execution context is not available in detached frame "https://..." (are you trying to evaluate?)
我使用WebDrivero的默认配置是在内部使用Puppeter。当我在谷歌上搜索错误时,我得到了一个添加以下标志的建议:
'--disable-web-security', '--disable-features=IsolateOrigins,site-per-process'
我这么做了,但没用:
remote({
logLevel: 'trace',
capabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
args: ['--disable-web-security', '--disable-features=IsolateOrigins,site-per-process']
}
}
})
我想在REPL中试用它来进行更多的调试,但我还没有弄清楚如何在启动REPL时添加这些参数:
npx wdio repl chrome
到目前为止,我所尝试的一切都失败了。如果有人知道怎么做,请告诉我
我通常不做web自动化,我选择WebDrivero,因为我过去在移动自动化中使用过它。我想知道这是否是一个木偶演员特有的问题,它是否能在Selenium中工作,但我不太确定如何设置它。木偶演员只是开箱工作
任何关于如何克服此错误的指导都将不胜感激。结果很简单:
browser.switchToFrame($('#iFrame'))
// Doing stuff inside the frame that causes the next page to show.
// Now that iFrame is gone and I have to switch out of it, to continue:
browser.switchToParentFrame()
// After the above call the execution context is not in a detached frame anymore.