Are you looking for a quick reference to turn to every time you need to look up the basic operations of selenium? Well if you are then this is just what you need. We at Intellipaat understand that it could be a bit of a hassle to remember every aspect of technology and that is why we have come up with a Selenium cheat sheet to assist our learners whenever they need a handy reference containing all the basics of selenium.
|
Selenium Certification
|
|
|
Selenium Tutorial
|
|
|
What is Selenium
|
|
|
Selenium Interview Questions
|
|
|
Selenium Cheat Sheet
|
|
Load firefox from different location:
|
System.setProperty(“webdriver.firfox.bin”,“path/to/firfox/binary”); FirefoxProfilefp= new FirefoxProfile();
|
|
Load firfox addons
|
File file=new File(“path/to/extension.xpi”); fp.addextension(file)
|
|
Locating by ID
|
driver.findElement(By.id("q")).sendKeys("Se lenium 3");
|
|
Locating by Name
|
driver.findElement(By.name("q")).sendKeys ("Selenium 3");
|
|
Locating by Xpath
|
driver.findElement(By.xpath("//input[@id='q'])).sendKeys("Selenium 3");
|
|
Locating Hyperlinksby Link Text
|
driver.FindElement(By.LinkText("edit this page")).Click();
|
|
Locating by DOM
|
dom =document.getElementById('signinForm')
|
|
Locating by CSS
|
driver.FindElement(By.CssSelector("#rightbar> .menu >li:nth-of-type(2) > h4"));
|
|
Locating by ClassName
|
driver.findElement(By.className("profileheader"));
|
|
Locating by TagName
|
driver.findElement(By.tagName("select")).C lick();
|
|
Locating by LinkText
|
driver.findElement(By.linkText("NextP age")).click();
|
|
Locating by PartialLinkText
|
driver.findElement(By.partialLinkText(" NextP")).click();
|
|
Navigate to url
|
driver.get(“http://newexample.com”) driver.navigate().to(“http://newexample.com”)
|
|
Refresh page
|
driver.navigate().refresh()
|
|
Navigate forwards in browser history
|
driver.navigate().forward()
|
|
Navigate backwards in browser history
|
driver.navigate().back()
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.