Skip to content

Commit

Permalink
Browser testing (#1520)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Sep 21, 2023
1 parent 8e3d846 commit 646140b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2661,15 +2661,17 @@ def __init__(self, current):
# acceptInsecureCerts capability but it's only supported by latest Firefox releases.
#
profilepath = os.path.join(current.driver.getComponent().getSourceDir(), "scripts", "selenium", "firefox")
profile = webdriver.FirefoxProfile(profilepath)
self.driver = webdriver.Firefox(firefox_profile=profile)
options = webdriver.FirefoxOptions()
options.set_preference("profile", profilepath)
self.driver = webdriver.Firefox(options=options)
elif driver == "Ie":
# Make sure we start with a clean cache
capabilities = webdriver.DesiredCapabilities.INTERNETEXPLORER.copy()
capabilities["ie.ensureCleanSession"] = True
self.driver = webdriver.Ie(capabilities=capabilities)
options = webdriver.IeOptions()
options.ensure_clean_session = True
self.driver = webdriver.Ie(options=options)
elif driver == "Safari" and int(port) > 0:
self.driver = webdriver.Safari(port=int(port), reuse_service=True)
service = webdriver.SafariService(port=port, reuse_service=True)
self.driver = webdriver.Safari(service=service)
else:
self.driver = getattr(webdriver, driver)()
except:
Expand Down

0 comments on commit 646140b

Please sign in to comment.