Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
WebDriver API Cheat Sheets●A short set of Summary Cheat Sheets for HandsOn Working With WebDriver●Contents:– Basic API com...
http://www.mindmeister.com/280141421/selenium-2-webdriver-commandsWebDriver Level BasicsWebElementInterrogationBasicshttp:...
http://www.mindmeister.com/280141421/selenium-2-webdriver-commandsWebElementManipulationSynchronisation
HTML, WebDomain
IntelliJ Tips●Use Code Completion●ctrl+Q for Documentation of Commands●ctrl+click to view the method code●Switch on AutoSc...
SlowLoadableCompnent●Public interface– get()●loads and waits for component to be availableextends SlowLoadableComponent<Pa...
13Selectors CSS Selectors* - any#id.classtag[attribute][attribute="value"]tag[attribute="value"]tag[attr1=val1][attr2=val2...
Upcoming SlideShare
Loading in …5
×

Webdriver cheatsheets summary

38,601 views

Published on

A set of slides that you can use to 'cheatsheet' your way to Selenium 2 WebDriver mastery. Formatted as the handouts I use on my Selenium WebDriver training.

Published in: Technology
  • D0WNL0AD FULL ▶ ▶ ▶ ▶ http://1lite.top/7ZDmK ◀ ◀ ◀ ◀
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Webdriver cheatsheets summary

  1. 1. WebDriver API Cheat Sheets●A short set of Summary Cheat Sheets for HandsOn Working With WebDriver●Contents:– Basic API commands– Hamcrest matchers & Junit– IntelliJ Tips– CSS & Xpath Selectors– Contact DetailsSeleniumSimplified.com | compendiumdev.co.uk | eviltester.comCopyright Alan Richardson,Compendium Developments@eviltesterCreated to support our Selenium2 WebDriver Training CoursesAPI Overviewhttp://www.mindmeister.com/280141421/selenium-2-webdriver-commands
  2. 2. http://www.mindmeister.com/280141421/selenium-2-webdriver-commandsWebDriver Level BasicsWebElementInterrogationBasicshttp://www.mindmeister.com/280141421/selenium-2-webdriver-commands
  3. 3. http://www.mindmeister.com/280141421/selenium-2-webdriver-commandsWebElementManipulationSynchronisation
  4. 4. HTML, WebDomain
  5. 5. IntelliJ Tips●Use Code Completion●ctrl+Q for Documentation of Commands●ctrl+click to view the method code●Switch on AutoScroll●Find Symbol– Shift + Cntrl + Alt + N●Find Class– Cntrl + N●Find File– Shift + Ctnrl + N10●ExpectedConditions static methods●Custom ExpectedConditionSynchronisation WebDriverWaitprivate ExpectedCondition<WebElement> optionWithValueDisplayed(final String value) {return new ExpectedCondition<WebElement>() {@Overridepublic WebElement apply(WebDriver webDriver) {return webDriver.findElement(By.cssSelector("option[value=" + value + "]") );}};}new WebDriverWait(driver,10).until(optionWithValueDisplayed(By.id("combo2"),"Java") );new WebDriverWait(driver,10).until(ExpectedConditions.titleIs("HTML Form Elements"));
  6. 6. SlowLoadableCompnent●Public interface– get()●loads and waits for component to be availableextends SlowLoadableComponent<PageObjectClassName>●Call super constructor in constructorpublic PageObjectClassName(WebDriver driver) {super(new SystemClock(), 10);this.driver = driver;}●Implement load and isLoaded– isLoaded throws a new Error if not loaded– I often leave the load part empty if I navigate to the page●@Test●@Before, @After (method level)●@BeforeClass, @AfterClass (static)Hamcrest Matchers & JUnit●is●not●Number– greaterThan,– greaterThanOrEqualTo,– lessThan,– lessThanOrEqualTo - testordering●Text– equalToIgnoringCase– equalToIgnoringWhiteSpace– containsString,– endsWith,– startsWith●Collections– hasEntry,– hasKey,– hasValue - test a map contains anentry, key or value– hasItem,– hasItems - test a collectioncontains elements– hasItemInArray - test an arraycontains an element●notNullValue,●nullValue - test for nullhttp://code.google.com/p/hamcrest/wiki/Tutorial#A_tour_of_common_matcherse.g. assertThat(driver.getTitle(), is(not(“bob”));
  7. 7. 13Selectors CSS Selectors* - any#id.classtag[attribute][attribute="value"]tag[attribute="value"]tag[attr1=val1][attr2=val2]tag[att1=val1], orThisTag= ( or ")*="anywhere in value"^="start of value"$="end of value"~="spaceSeperatedValue"PathsA > B (child)A B (any descendant)A + B (As B sibling)tag:first-childXPATH Selectors// - match anywhere/ - match from root//* - any element//tag//*[@attribute]//*[@attribute="value"]//tag[@attribute="value"]//tag1/tag2 (child)//tag1//tag2 (any descendant)//tag1/../.. (.. to go up)//*[.=element text][@at1="a" and @at2="b"]and, or, =, !=, <, >, >=, <-Functionscontains(@a,"alu")starts-with(@a,"v")ends-with(@a,"e")Indexing//tag[1]XPath References●http://www.w3schools.com/xpath/●http://www.simple-talk.com/dotnet/.net-framework/xpath,-css,-dom-and-selenium-the-rosetta-stone/CSS References●http://reference.sitepoint.com/css/selectorref●http://net.tutsplus.com/tutorials/html-css-techniques/the-30-css-selectors-you-must-memorize/●http://www.quirksmode.org/css/contents.html●http://www.w3schools.com/cssref/css_selectors.asp

×