gpt4 book ai didi

javascript - 失败 : null value in entry: name=null error while switching Popup window

转载 作者:行者123 更新时间:2023-11-29 16:50:28 25 4
gpt4 key购买 nike

我正在尝试切换 AngularJS 应用程序的弹出窗口。以下是我的代码:

    browser.ignoreSynchronization = true;
browser.getAllWindowHandles().then(function (handles) {
browser.switchTo().window(handles[1]);

});

出现以下错误:

Failed: null value in entry: name=null
Stack:
UnknownError: null value in entry: name=null

最佳答案

您可能尝试在实际打开之前切换到新选项卡 - 等待窗口句柄计数超过自定义预期条件下的所需计数:

function windowCount(count) {
return function () {
return browser.getAllWindowHandles().then(function (handles) {
return handles.length >= count;
});
};
};
browser.wait(windowCount(2), 10000);

browser.getAllWindowHandles().then(function (handles) {
browser.switchTo().window(handles[1]);
});

关于javascript - 失败 : null value in entry: name=null error while switching Popup window,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36477459/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com