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.

Paweł Guździoł - Hheadless functional testing with selenium and phantomjs

474 views

Published on

Trójmiejska Grupa Testerska #6

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Paweł Guździoł - Hheadless functional testing with selenium and phantomjs

  1. 1. HEADLESS TESTING WITH SELENIUM AND PHANTOMJS Paweł Guździoł
  2. 2. HEADLESS TESTING PhantomJS - is a WebKit-based browser without a GUI GhostDriver - is a pure JavaScript implementation of the WebDriver Wire Protocol for PhantomJS
  3. 3. ARCHITECTURE IMPLEMENTATION OF GHOSTDRIVER Source: http://www.assertselenium.com/headless-testing/getting-started-with-ghostdriver-phantomjs/
  4. 4. SETUP 1. Download PhantomJS 2. Extract an exe file 3. Set the phantomjs in the PATH 4. Start the PhantomJs in a Remote WebDriver mode phantomjs.exe –webdriver=8910
  5. 5. EXAMPLE @Test public void testDuckDuckGoSearching(){ WebDriver driver = new PhantomJSDriver(); driver.manage() .timeouts() .implicitlyWait(5, TimeUnit.SECONDS); driver.get("https://duckduckgo.com"); driver.findElement(By.id("search_form_input_homepage")) .sendKeys("Selenium"); driver.findElement(By.id("search_button_homepage")) .click(); String result = driver.findElement(By.id("r1-0")) .getText(); assertTrue(result.contains("Selenium - Web Browser Automation")); } }
  6. 6. BENCHMARKING Firefox – 21 s PhantomJS – 7s
  7. 7. THANKS!

×