Skip to content

Commit

Permalink
Merge pull request #145 from rsporny/electron-driver-support
Browse files Browse the repository at this point in the history
issue #144: add support for electron driver
  • Loading branch information
ElSnoMan authored Nov 5, 2020
2 parents a2fca29 + 7b6a840 commit 7f8b811
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pylenium/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import requests
from faker import Faker
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import TimeoutException, WebDriverException
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support.wait import WebDriverWait
Expand Down Expand Up @@ -609,7 +609,10 @@ def window_size(self) -> dict:
def maximize_window(self) -> 'Pylenium':
""" Maximizes the current Window. """
self.log.info('py.maximize_window() - Maximize window')
self.webdriver.maximize_window()
try:
self.webdriver.maximize_window()
except WebDriverException as e:
self.log.error(f'unable to maximize window: {e.msg}')
return self

def set_page_load_timeout(self, timeout: int) -> 'Pylenium':
Expand Down

0 comments on commit 7f8b811

Please sign in to comment.