question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't accept alert in a new tab

See original GitHub issue

[//]: # NOTE: This repository only maintains packages that are listed in the Readme. Please make sure that your issue is directly caused by one of these packages and if not file an issue in the correct 3rd party package repository.

Environment (please complete the following information):

  • WebdriverIO version: [4.3.6]
  • Mode: [Standalone mode]
  • Node.js version: [12.9.1]
  • Browser name and version: [Chrome]
  • Platform name and version: [MacOS]
  • Additional wdio packages used (if applicable): [wdio-chromedriver-service]

Config of WebdriverIO Wdio/Async I use webdriverio by calling the webdriverio Remote Method

capabilities: { services: [‘chromedriver’] browserName: ‘chrome’ }

Describe the bug The browser can’t accept alert When the browser switch to new tab

To Reproduce

it('test', async() => {
  const tab = await browser.createWindow('tab')    
  await browser.switchToWindow(tab.handle);  
  // Open the developer tool and execute javascript "alert("TEST")"  
  await waitTime(8000) // wait 8 seconds because of executing javascript: alert("TEST")  
  await browser.acceptAlert();
}

Expected behavior the browser accepts alert in the new tab

Log after calling the browser.acceptAlert() the logger doesn’t write any log and timed out (after 60 seconds)

Please use the correct markdown

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
christian-bromanncommented, Sep 15, 2020

PR was merged and released. Closing.

1reaction
lumyjuwoncommented, Aug 2, 2020

@ilamparithiNatarajan I finish fixing this bug soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

A big problem: can not accept the alert when use selenium ...
here is the answer: ... It can work correctly! After accept the primitive alert, other alert popup in the second tab can be...
Read more >
Selenium/Chromedriver hangs on a new tab containing an alert
It feels like Selenium wants to switch to the other page and interact with it somehow but it cannot because there is an...
Read more >
How to handle PopUps and Alerts in Selenium with examples?
To switch the control to the recently opened pop up window Driver.switchTo().alert(); is used; Alert is accepted using alert.accept(); method.
Read more >
Google Chrome - Open pop-ups in new tab? - Super User
There is a 3 step workaround you can do this by. You should know when the popup will be opened. Popups are blocked...
Read more >
Remove unwanted ads, pop-ups and malware - Android
If you're seeing some of these problems with Chrome, you might have unwanted software or malware installed on your computer: Pop-up ads and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found