Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

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

New driver instance starts when trying to switch to alert #117

Closed
maxim-zaitsev opened this issue Mar 25, 2017 · 9 comments
Closed

New driver instance starts when trying to switch to alert #117

maxim-zaitsev opened this issue Mar 25, 2017 · 9 comments
Labels

Comments

@maxim-zaitsev
Copy link

maxim-zaitsev commented Mar 25, 2017

Hi all!
I am using pre-release version of selene: 1.0.0.a10
I got an error when i was trying to switch to alert.
Here is a script to reproduce:

`
from selene.browser import driver, visit
from selene.support.jquery_style_selectors import s
from selene import config
from selene.browsers import Browser

config.browser_name = Browser.CHROME

visit('http://javascript.ru/alert')
s('input[value="Запустить"]').click()
alert = driver().switch_to.alert # Current driver instance has been closed and new driver instance is starting
alert.accept() # so we get an exception at the last step: selenium.common.exceptions.NoAlertPresentException: Message: no alert open
`

@yashaka
Copy link
Owner

yashaka commented Mar 25, 2017 via email

@SergeyPirogov
Copy link
Contributor

Hmmm, it's veeery interesting, probably we should add unit test for this.

@yashaka
Copy link
Owner

yashaka commented Mar 25, 2017 via email

@maxim-zaitsev
Copy link
Author

The same case for raw selenium is OK, no errors:

`
from selenium import webdriver

driver = webdriver.Chrome(executable_path=r"C:\_Tools\chromedriver.exe")
driver.get('http://javascript.ru/alert')
driver.find_element_by_css_selector('input[value="Запустить"]').click()
alert = driver.switch_to.alert
alert.accept()
`

@yashaka
Copy link
Owner

yashaka commented Mar 25, 2017 via email

@SergeyPirogov
Copy link
Contributor

@zaitsevmaxim80 could you please clarify which python version do you use? Seems this problem relates to v2 vs v3 string unicode =(

@maxim-zaitsev
Copy link
Author

I am using
Python 3.5.3
32-bit

@SergeyPirogov
Copy link
Contributor

Thank you. I already identified the problem.

@SergeyPirogov
Copy link
Contributor

Fixed by #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants