Skip to content

Divinemonk/selenium_cheatsheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Selenium cheatsheet




To import webdriver module in python use below import statement

from selenium import webdriver



Driver setup:

  • Firefox: firefoxdriver = webdriver.Firefox(executable_path=”Path to Firefox driver”)

  • Chrome: chromedriver = webdriver.Chrome(executable_path=”Path to Chrome driver”)

  • Internet Explorer: iedriver = webdriver.IE(executable_path=”­Pat­h To­ IEDriverServer.exe”)

  • Edge: edgedriver = webdriver.Edge(executable_path=”­Pat­h To­ MicrosoftWebDriver.exe”)

  • Opera: operadriver = webdriver.Opera(executable_path=”­Pat­h To­ operadriver”)

  • Safari: SafariDriver now requires manual installation of the extension prior to automation


Download the webdrivers from Official Page



Browser Arguments:

–headless

To open browser in headless mode. Works in both Chrome and Firefox browser

–start-maximized

To start browser maximized to screen. Requires only for Chrome browser. Firefox by default starts maximized

–incognito

To open private chrome browser

–disable-notifications

To disable notifications, works Only in Chrome browser

http://allselenium.info/python-selenium-commands-cheat-sheet-frequently-used/



A Divinemonk creation!