Skip to content

Commit

Permalink
Update requirements.txt and improve some code
Browse files Browse the repository at this point in the history
  • Loading branch information
cryzed committed Oct 29, 2016
1 parent ae86aaf commit daa858d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions requirements.txt
@@ -1,8 +1,9 @@
colorama==0.3.3
py==1.4.26
pypandoc==0.9.6
pytest==2.7.0
requests==2.6.0
selenium==2.45.0
six==1.9.0
tld==0.7.2
idna==2.1
py==1.4.31
pytest==3.0.3
requests==2.11.1
requests-file==1.4.1
selenium==3.0.1
selenium-requests==1.3
six==1.10.0
tldextract==2.0.2
4 changes: 2 additions & 2 deletions seleniumrequests/request.py
Expand Up @@ -198,10 +198,10 @@ def request(self, method, url, **kwargs):

previous_window_handles = set(self.window_handles)
self.execute_script("window.open('%s://%s/', '_blank');" % (components.scheme, components.netloc))
difference = set(self.window_handles) - set(previous_window_handles)
difference = set(self.window_handles) - previous_window_handles

if len(difference) == 1:
opened_window_handle = tuple(difference)[0]
opened_window_handle = difference.pop()

# Most WebDrivers will automatically wait until the switched-to window handle has finished loading
self.switch_to.window(opened_window_handle)
Expand Down

0 comments on commit daa858d

Please sign in to comment.