Selenium WebDriver
Tests on Browsers
Remember to check version of WebDriver with current browser version.
Create a new Python Package in your project
Create a new Python File (and then code and run there)
Mozilla Firefox
Firefox WebDriver is called geckodriver.exe
After this program the Firefox doesn't close.
Xpath


Google Chrome
Google Chrome driver is call chromedriver.exe
When using class in ChromeDriver, after the page is load the browser will close. Without class the browser stay on this site.
Xpath


Extension Ranorex Selocity
Inspect element
Ranorex Selocity show <input> css / xpath to copy to automation tests

Internet Explorer
Internet Explorer driver is called IEDriverServer.exe
Requirements to run tests on Internet Explorer
Set a zoom on 100%

2. Make sure that Protected Mode on every of 4 types of zone are the same (Disable or Enable) a) Internet b) Local intranet c) Trusted sites d) Restricted sites

Safari
It's only supported on Macs. (Apple)
Commands
import webdriver
set a webdriver
open a URL
Finding elements
By
CSS Selectors
Syntax:
tag[attribute='value']
"#" -> Id "." -> Class
Appending Classes
.class1.class2.class3 -> Until we find a unique element
Wildcards in CSS Selectors
Syntax: tag[attribute<special character>='value']
Finding Children CSS

Xpath
Single slash ‘/’ anywhere in xpath signifies to look for the element immediately inside the parent element. Double slash ‘//’ signifies to look for any child or nested-‐ child element inside the parent element.
Syntax: //tag[@attribute='value']
contains
Syntax: //tag[contains(attribute, ‘value’)]
starts-with
Syntax: //tag[starts-‐with(attribute, ‘value’)]

parent and sibling
Parent Syntax: xpath-‐to-‐some-‐element//parent::

Preceding Sibling Syntax: xpath-‐to-‐some-‐element//preceding‐sibling::

Following Sibling Syntax: xpath-‐to-‐some-‐element//following-sibling::

Practice
1. Find the price of the course "Python Programming Language"
http://letskodeit.teachable.com/p/practice

2. Find the Project name from Owner Maria Kennedy
https://dhtmlx.com/docs/products/dhtmlxGrid/


Last updated
Was this helpful?
