相关文章推荐

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get this error:
......\MobilePages\RecipientPageM.py:23: in choose_recipient_from_list
alert.accept()
..........\selene-virt\lib\site-packages\selenium\webdriver\common\alert.py:80: in accept
self.driver.execute(Command.ACCEPT_ALERT)
..........\selene-virt\lib\site-packages\selenium\webdriver\remote\webdriver.py:233: in execute
self.error_handler.check_response(response)
E selenium.common.exceptions.NoAlertPresentException: Message: no alert open
E (Session info: chrome=58.0.3029.81)
E (Driver info: chromedriver=2.29.461591

While when i use standart driver it works fine:

self.driver = webdriver.Chrome(ChromeDriverManager().install())
alert = self.driver.switch_to.alert
alert.accept()
          

@SergeyPirogov I'm absolutely sure.
I even tried to put time.sleep(10) before switch to alert, but it also doesn't work. Alert appears and after 10 sec i got this error.
As I said when i use standard driver it works fine without any waitings for alert to present.

Hm... We have tests for alerts: https://github.com/yashaka/selene/blob/master/tests/integration/test_alert.py

And they pass... That means that something may be wrong with your alert, @byakatat :)

Can you share link to production site? So we can look more closely what kind of alert do you have?

  • Login here login page
    with email: [email protected] and password: 123456
  • Click on the logo on the left top corner - a main page will be opened
  • Click on any bouquet - a bouquet page will be opened
  • Click "Оформить заказ" button - a cart page will be opened
  • Click "Оформить заказ" button again - a delivery date page will be opened
  • Click "Следующий шаг" button - a recipient page will be opened
  • And here you should choose recipient from dropdown, look here https://yadi.sk/i/pAdyELYD3JC9Sm
    and allert will appear.
  • And as I mentioned, when I use standard driver tests pass.

     
    推荐文章