Selenium Webdriver Cheat Sheet
Selenium Webdriver Cheat Sheet
Selenium Webdriver Cheat Sheet
Chrome Refer
Part2-Page59 System.setProperty("WebDriver.chrome.
driver", Selenium Exceptions
System.getProperty("user.dir")+"//Browse
'Server Exception : sessionId should not Replace Chrome Driver
rDrivers//chromedriver.exe");
be nullRefer Part2-Page160 with Latest Version
Download from WebDriver driver = new
https://sites.google.com/a/chrom ChromeDriver(); ERROR: No sessionId providedRefer Use Jenkins
Part2-Page160
ium.org/chromedriver/download
s UnreachableBrowserException Refer
Registry Key Changes
Internet ExplorerRefer System.setProperty("WebDriver.ie.driver" Part2-Page160 Recommended
Part2-Page59 , "PathTo//IEDriverServer.exe");
Illegal state exception using Selenium Get latest Firefox Gecko
Download from The Internet WebDriver driver = new 3Refer Part2-Page161 Driver
Explorer Driver Server at InternetExplorerDriver();
http://docs.seleniumhq.org/down Annotations
load/
TestNG @BeforeSuite @AfterSuite @BeforeTest @AfterTest
@BeforeGroups @AfterGroups @BeforeClass @AfterClass
Selenium Locators
@BeforeMethod @AfterMethod
Locating by ID Refer driver.findElement(By.id("q")).sendKeys("Se
JUnit @After @AfterClass @Before @BeforeClass @Ignore @Test
Part2-Page37 lenium 3");
Disable a driver.getElementsByName('<ObjectID>')
FieldRefer [0].setAttribute('disabled', '');
Part2-Page64
Enable a driver.getElementsByName('<ObjectID>')
FieldRefer [0].removeAttribute('disabled';
Part2-Page64
FileUtils.copyFile(snapshot, new
File("C:\\screenshot.jpg"));
System.out.print(pagetitle);
Implicit driver.manage().timeouts().implicitlyWait(10,
WaitRefer TimeUnit.SECONDS);
Part2-Page69
wait.until(ExpectedConditions.textToBePresentInElement
Located(By.xpath("//div[@id='<Object ID>']"), "Enter
Your Personal Details"));
.withTimeout(20, SECONDS)
SleepRefer
Thread.Sleep(10);
Part2-Page70