Last active
December 26, 2015 21:29
-
-
Save hjwp/7216676 to your computer and use it in GitHub Desktop.
selenium phantomjs current_url bug minimal repro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from selenium import webdriver | |
| import sys | |
| if 'phantom' in sys.argv: | |
| browser = webdriver.PhantomJS() | |
| else: | |
| browser = webdriver.Firefox() | |
| browser.implicitly_wait(3) | |
| try: | |
| browser.get('http://www.google.com') | |
| start_url = browser.current_url | |
| browser.find_element_by_name('q').send_keys('foo\n') | |
| end_url = browser.current_url | |
| assert end_url != start_url | |
| print 'OK' | |
| finally: | |
| browser.quit() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
expected behaviour is that, after the
send_keyscall which includes a back-n (enter), we trigger a page load, which should complete before we're able to check current_url again...