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.

[Android 10] accept_alert dismisses the alert instead.

See original GitHub issue

The problem

alert.accept dismisses the alert instead of accepting it on Android 10, however, on older versions, it accepts the alert properly.

Environment

  • Appium version: 1.15.1
  • Desktop OS/version used to run Appium: MacOS 10.15.2
  • Mobile platform/version under test: Android 10
  • Real device or emulator/simulator: Real Device

Details

I am handling Location permissions pop-up with alerts. After switching to the alert, I expect alert.accept to tap on allowing the permission. However, the statement results in rejecting permission (Deny).

Screenshot 2020-01-15 at 16 07 06

Link to Appium logs

Appium Logs

Code To Reproduce Issue [ Good To Have ]

alert = driver.switch_to.alert
alert.accept

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, Jan 18, 2020

The change has been published to appium@beta

0reactions
mharis05commented, Jan 15, 2020

Yes, that’s also what I was wondering about, because of the variation in how alert appears like the number of buttons. I will use the label to resolve this in my own code. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to handle alerts in android using appium - Stack Overflow
Appium comes with a default capability to accept, dismiss alerts capabilities.SetCapability("autoAcceptAlerts", true); capabilities.
Read more >
Why does an alert sometimes appear to come back after I ...
When an alert publisher sends an update to an existing alert Google Now will show a Public Alerts card with the new content...
Read more >
acceptAlert | API Reference - Nightwatch.js
acceptAlert (). Accepts the currently displayed alert dialog. Usually, this is equivalent to clicking on the 'OK' button in the dialog.
Read more >
How to handle PopUps and Alerts in Selenium with examples?
3rd Step: Prompt alert box opens where the user can enter text in the text box. After entering user can accept or dismiss...
Read more >
WebDriverIO Tutorial: Handling Alerts & Overlay In Selenium
alert ().accept() selenium java. It helps users to click on the 'OK' button on Alert pop up. Syntax: browser.acceptAlert();.
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