SlideShare a Scribd company logo
Gems of Selenium Anand Ramdeo  Komal Joshi @testinggeek www.TestingGeek.com
Selenium Is.. www.atlantissw.com | www.TestingGeek.com
A bit of History.. www.atlantissw.com | www.TestingGeek.com SELENIUM
It All Started Here Time and Expense application built using Python+Plone @ Thoughtworks Goal was  “Fast, Fast, Fast” www.atlantissw.com | www.TestingGeek.com ADD ROW
It All Started Here Time and Expense application built using Python+Plone @ Thoughtworks Goal was  “Fast, Fast, Fast” www.atlantissw.com | www.TestingGeek.com ADD ROW
It All Started Here Time and Expense application built using Python+Plone @ Thoughtworks Goal was  “Fast, Fast, Fast” www.atlantissw.com | www.TestingGeek.com ADD ROW
Problems.. www.atlantissw.com | www.TestingGeek.com
And Solutions.. Mozilla Extension – “Driftwood” by Andrew McCormick  from Thoughtworks. Worked, but it was firefox only solution. Paul Gross and Jasson Huggin set out to implement Fit for JS. Which eventually became Selenium Core or Java Script Test Runner www.atlantissw.com | www.TestingGeek.com
Popularity of Selenium www.atlantissw.com | www.TestingGeek.com
Reason of Success www.atlantissw.com | www.TestingGeek.com
In search of treasure @testinggeek www.TestingGeek.com The journey begins.. Want to automate ?  What are the common problems faced by people when using selenium IDE?
In search of treasure @testinggeek www.TestingGeek.com Treasure is …. Reliable automation. Stable automation. Maintainable automation. Effective Automation .
@testinggeek www.TestingGeek.com Found my first Gem…. UI Element   How can this precious gem help me?
UI Element is... @testinggeek www.TestingGeek.com ...a mapping between semantically meaningful names of elements on webpages, and the elements. ...defined using JSON
Abstraction With UI-Element selenium.type("q", “TestingGeek"); selenium.click("btnG"); @testinggeek www.TestingGeek.com LOGIN_BUTTON = "css=input[value='Log in']" DELETE_CONFIRMATION = "css=input[value='\"Yes, I'm sure\"']"   myMap.addPageset({     name: 'allPages',     description: 'All WLL Pages',     pathRegexp: '.*' }); myMap.addElement ('allPages', {     name: 'register'     , description: 'Register link on all the pages'     , locator: "xpath=//*[@id='user']/dd/a[1]"     })   sel.click("ui=allPages::register()")   Abstracting with UI Element
@testinggeek www.TestingGeek.com I want to extend Selenium with some new assertions,actions No problem User-extension.js is here for that.
Extending Slenium... Selenium Object Prototype Pagebot Object Prototype. On startup, Selenium will automatically look through methods on these prototypes, using name patterns to recognize which ones are actions, assertions and locators.   @testinggeek www.TestingGeek.com
Automation is incomplete without cross browser testing Selenium RC gem for different browser… * iehta * firefox * iexplore * chrome * custom (for custom browsers) @testinggeek www.TestingGeek.com
https... Different options of selenium… https Multiwindow=<true/false> Firefoxtemplate=<default template location> @testinggeek www.TestingGeek.com
Collecting all the gems and putting in the treasure chest @testinggeek www.TestingGeek.com
Is this the only treasure The real gems are in your minds in your brains. Come up with a solution Implement a simple but effective solution. @testinggeek www.TestingGeek.com
Automate using wrappers. @testinggeek www.TestingGeek.com SA Use a combination of tools.... Selenium + Auto it. Selenium + Batch files.
@testinggeek www.TestingGeek.com SA /** * This method would just kill the PDF */ public void closesPDF(){ { String[] dialog = new String[] { &quot;src\\test\\resources\\KillAcroRd32.bat&quot;}; try { Process p = Runtime.getRuntime().exec(dialog); System.out.println(p.getErrorStream().toString()); System.out.println(p.getInputStream().toString()); System.out.println(p.getOutputStream().toString()); System.out.println(&quot;After execution&quot;); } catch (IOException e) { // TODO Auto-generated catch block System.out.println(&quot;In the exception&quot;); e.printStackTrace(); throw new AssertionError(&quot;No Dialogue box displayed&quot;); }   } }
Easy to read Natural language automation Simple easy to read language POM. @testinggeek www.TestingGeek.com
Componentise your automation @testinggeek www.TestingGeek.com
Add dynamism... Connecting to the databses… @testinggeek www.TestingGeek.com
@testinggeek www.TestingGeek.com All this is less effective if automation does not run automatically......
Integrate with CI tools @testinggeek www.TestingGeek.com Mavenise your automation... And  integrate them with Hudson...
Distribute the Tests  @testinggeek www.TestingGeek.com With Selenium Grids or Hudson Slaves...
Integrate with CI tools @testinggeek www.TestingGeek.com What about Selenium 2.0 ?..... Will my old selenium tests run in 2.0?
Selenium 2.0 @testinggeek www.TestingGeek.com -Web Driver -  Presentation redering etc.
@testinggeek www.TestingGeek.com import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.RenderedWebElement; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class TestingGeek { public static void main(String[] args) throws Exception { // The  Firefox driver supports javascript WebDriver driver =  new FirefoxDriver(); // Go to the TestingGeek home page driver.get(&quot;http://www.testinggeek.com&quot;); // Enter the query string &quot;Cheese&quot; //WebElement query = driver.findElement(By.name(&quot;q&quot;)); WebElement menu= driver.findElement(By. id(&quot;menu27&quot;)); menu.click(); // query.sendKeys(&quot;Cheese&quot;); // Sleep until the  div we want is visible or 5 seconds is over long end = System. currentTimeMillis() + 5000; while (System. currentTimeMillis() < end) { // Browsers which render content (such as  Firefox and IE) // return &quot;RenderedWebElements&quot; //  RenderedWebElement resultsDiv = (RenderedWebElement) driver.findElement(By.className(&quot;gac_m&quot;)); RenderedWebElement resultsDiv = (RenderedWebElement) driver.findElement(By. id(&quot;menu27&quot;));  // If results have been returned, // the results are displayed in a drop down. if (resultsDiv.isDisplayed()) { break; } } // And now list the suggestions //List<WebElement> allSuggestions = driver.findElements(By. xpath(&quot;//td[@class='gac_c']&quot;)); List<WebElement> menus = driver.findElements(By. xpath(&quot;//div/div/div/ul/li[2]/ul&quot;)); for (WebElement menu1 : menus) { System. out.println(menu1.getText()); } } }
Thank You. Anand Ramdeo www.TestingGeek.com @testinggeek www.AtlantisSw.com [email_address] @testinggeek www.TestingGeek.com
Ad

More Related Content

What's hot (20)

Webdriver cheatsheets summary
Webdriver cheatsheets summaryWebdriver cheatsheets summary
Webdriver cheatsheets summary
Alan Richardson
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJS
Peter Drinnan
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015
Iakiv Kramarenko
 
High Performance JavaScript 2011
High Performance JavaScript 2011High Performance JavaScript 2011
High Performance JavaScript 2011
Nicholas Zakas
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
Jim Lynch
 
Automation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and BeyondAutomation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and Beyond
Alan Richardson
 
Testing React Applications
Testing React ApplicationsTesting React Applications
Testing React Applications
stbaechler
 
Test automation
Test  automationTest  automation
Test automation
Kaushik Banerjee
 
Page object pattern
Page object patternPage object pattern
Page object pattern
Petro Konopelko
 
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Alan Richardson
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
Ludmila Nesvitiy
 
Introducing Playwright's New Test Runner
Introducing Playwright's New Test RunnerIntroducing Playwright's New Test Runner
Introducing Playwright's New Test Runner
Applitools
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
SQALab
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)
Alin Pandichi
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8
nagpalprachi
 
Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]
Iakiv Kramarenko
 
Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium  Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium
Zoe Gilbert
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS app
Aleks Zinevych
 
Automation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and BeyondAutomation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and Beyond
TechWell
 
From Good to Great: Functional and Acceptance Testing in WordPress.
From Good to Great: Functional and Acceptance Testing in WordPress.From Good to Great: Functional and Acceptance Testing in WordPress.
From Good to Great: Functional and Acceptance Testing in WordPress.
David Aguilera
 
Webdriver cheatsheets summary
Webdriver cheatsheets summaryWebdriver cheatsheets summary
Webdriver cheatsheets summary
Alan Richardson
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJS
Peter Drinnan
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015
Iakiv Kramarenko
 
High Performance JavaScript 2011
High Performance JavaScript 2011High Performance JavaScript 2011
High Performance JavaScript 2011
Nicholas Zakas
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
Jim Lynch
 
Automation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and BeyondAutomation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and Beyond
Alan Richardson
 
Testing React Applications
Testing React ApplicationsTesting React Applications
Testing React Applications
stbaechler
 
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
Alan Richardson
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
Ludmila Nesvitiy
 
Introducing Playwright's New Test Runner
Introducing Playwright's New Test RunnerIntroducing Playwright's New Test Runner
Introducing Playwright's New Test Runner
Applitools
 
Better Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component PatternBetter Page Object Handling with Loadable Component Pattern
Better Page Object Handling with Loadable Component Pattern
SQALab
 
Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)Unit Testing your React / Redux app (@BucharestJS)
Unit Testing your React / Redux app (@BucharestJS)
Alin Pandichi
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8
nagpalprachi
 
Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]
Iakiv Kramarenko
 
Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium  Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium
Zoe Gilbert
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS app
Aleks Zinevych
 
Automation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and BeyondAutomation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and Beyond
TechWell
 
From Good to Great: Functional and Acceptance Testing in WordPress.
From Good to Great: Functional and Acceptance Testing in WordPress.From Good to Great: Functional and Acceptance Testing in WordPress.
From Good to Great: Functional and Acceptance Testing in WordPress.
David Aguilera
 

Similar to Gems Of Selenium (20)

Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
Ben Hall
 
Continuous integration with Git & CI Joe
Continuous integration with Git & CI JoeContinuous integration with Git & CI Joe
Continuous integration with Git & CI Joe
Shawn Price
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
 
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made EasySeven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
mguillem
 
สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1
ทวิร พานิชสมบัติ
 
Jasmine with JS-Test-Driver
Jasmine with JS-Test-DriverJasmine with JS-Test-Driver
Jasmine with JS-Test-Driver
Devesh Chanchlani
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
ipolevoy
 
Basic testing with selenium
Basic testing with seleniumBasic testing with selenium
Basic testing with selenium
Søren Lund
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnet
Vlad Maniak
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
ciklum_ods
 
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Codemotion
 
Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
Panoptic Development, Inc.
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
Doncho Minkov
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
Carlos Sanchez
 
Selenium
SeleniumSelenium
Selenium
Adam Goucher
 
I one aolpage-test-2010
I one aolpage-test-2010I one aolpage-test-2010
I one aolpage-test-2010
Nicholas Tang
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with example
shadabgilani
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
alice yang
 
Demystifying Keyword Driven Using Watir
Demystifying Keyword Driven Using WatirDemystifying Keyword Driven Using Watir
Demystifying Keyword Driven Using Watir
Hirday Lamba
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
Ben Hall
 
Continuous integration with Git & CI Joe
Continuous integration with Git & CI JoeContinuous integration with Git & CI Joe
Continuous integration with Git & CI Joe
Shawn Price
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
 
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made EasySeven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
mguillem
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
ipolevoy
 
Basic testing with selenium
Basic testing with seleniumBasic testing with selenium
Basic testing with selenium
Søren Lund
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnet
Vlad Maniak
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
ciklum_ods
 
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Codemotion
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
Carlos Sanchez
 
I one aolpage-test-2010
I one aolpage-test-2010I one aolpage-test-2010
I one aolpage-test-2010
Nicholas Tang
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with example
shadabgilani
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
alice yang
 
Demystifying Keyword Driven Using Watir
Demystifying Keyword Driven Using WatirDemystifying Keyword Driven Using Watir
Demystifying Keyword Driven Using Watir
Hirday Lamba
 
Ad

More from Skills Matter (20)

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence
Skills Matter
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
Skills Matter
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Skills Matter
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheim
Skills Matter
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Skills Matter
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Skills Matter
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.js
Skills Matter
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Skills Matter
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Skills Matter
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Skills Matter
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Skills Matter
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#
Skills Matter
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testing
Skills Matter
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
Skills Matter
 
Serendipity-neo4j
Serendipity-neo4jSerendipity-neo4j
Serendipity-neo4j
Skills Matter
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
Skills Matter
 
Plug 20110217
Plug   20110217Plug   20110217
Plug 20110217
Skills Matter
 
Lug presentation
Lug presentationLug presentation
Lug presentation
Skills Matter
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
Skills Matter
 
Plug saiku
Plug   saikuPlug   saiku
Plug saiku
Skills Matter
 
5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence
Skills Matter
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
Skills Matter
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Skills Matter
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheim
Skills Matter
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Skills Matter
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Skills Matter
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.js
Skills Matter
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Skills Matter
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Skills Matter
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Skills Matter
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Skills Matter
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#
Skills Matter
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testing
Skills Matter
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
Skills Matter
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
Skills Matter
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
Skills Matter
 
Ad

Recently uploaded (20)

Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 

Gems Of Selenium

  • 1. Gems of Selenium Anand Ramdeo Komal Joshi @testinggeek www.TestingGeek.com
  • 2. Selenium Is.. www.atlantissw.com | www.TestingGeek.com
  • 3. A bit of History.. www.atlantissw.com | www.TestingGeek.com SELENIUM
  • 4. It All Started Here Time and Expense application built using Python+Plone @ Thoughtworks Goal was “Fast, Fast, Fast” www.atlantissw.com | www.TestingGeek.com ADD ROW
  • 5. It All Started Here Time and Expense application built using Python+Plone @ Thoughtworks Goal was “Fast, Fast, Fast” www.atlantissw.com | www.TestingGeek.com ADD ROW
  • 6. It All Started Here Time and Expense application built using Python+Plone @ Thoughtworks Goal was “Fast, Fast, Fast” www.atlantissw.com | www.TestingGeek.com ADD ROW
  • 7. Problems.. www.atlantissw.com | www.TestingGeek.com
  • 8. And Solutions.. Mozilla Extension – “Driftwood” by Andrew McCormick from Thoughtworks. Worked, but it was firefox only solution. Paul Gross and Jasson Huggin set out to implement Fit for JS. Which eventually became Selenium Core or Java Script Test Runner www.atlantissw.com | www.TestingGeek.com
  • 9. Popularity of Selenium www.atlantissw.com | www.TestingGeek.com
  • 10. Reason of Success www.atlantissw.com | www.TestingGeek.com
  • 11. In search of treasure @testinggeek www.TestingGeek.com The journey begins.. Want to automate ? What are the common problems faced by people when using selenium IDE?
  • 12. In search of treasure @testinggeek www.TestingGeek.com Treasure is …. Reliable automation. Stable automation. Maintainable automation. Effective Automation .
  • 13. @testinggeek www.TestingGeek.com Found my first Gem…. UI Element  How can this precious gem help me?
  • 14. UI Element is... @testinggeek www.TestingGeek.com ...a mapping between semantically meaningful names of elements on webpages, and the elements. ...defined using JSON
  • 15. Abstraction With UI-Element selenium.type(&quot;q&quot;, “TestingGeek&quot;); selenium.click(&quot;btnG&quot;); @testinggeek www.TestingGeek.com LOGIN_BUTTON = &quot;css=input[value='Log in']&quot; DELETE_CONFIRMATION = &quot;css=input[value='\&quot;Yes, I'm sure\&quot;']&quot; myMap.addPageset({     name: 'allPages',     description: 'All WLL Pages',     pathRegexp: '.*' }); myMap.addElement ('allPages', {     name: 'register'     , description: 'Register link on all the pages'     , locator: &quot;xpath=//*[@id='user']/dd/a[1]&quot;    }) sel.click(&quot;ui=allPages::register()&quot;) Abstracting with UI Element
  • 16. @testinggeek www.TestingGeek.com I want to extend Selenium with some new assertions,actions No problem User-extension.js is here for that.
  • 17. Extending Slenium... Selenium Object Prototype Pagebot Object Prototype. On startup, Selenium will automatically look through methods on these prototypes, using name patterns to recognize which ones are actions, assertions and locators. @testinggeek www.TestingGeek.com
  • 18. Automation is incomplete without cross browser testing Selenium RC gem for different browser… * iehta * firefox * iexplore * chrome * custom (for custom browsers) @testinggeek www.TestingGeek.com
  • 19. https... Different options of selenium… https Multiwindow=<true/false> Firefoxtemplate=<default template location> @testinggeek www.TestingGeek.com
  • 20. Collecting all the gems and putting in the treasure chest @testinggeek www.TestingGeek.com
  • 21. Is this the only treasure The real gems are in your minds in your brains. Come up with a solution Implement a simple but effective solution. @testinggeek www.TestingGeek.com
  • 22. Automate using wrappers. @testinggeek www.TestingGeek.com SA Use a combination of tools.... Selenium + Auto it. Selenium + Batch files.
  • 23. @testinggeek www.TestingGeek.com SA /** * This method would just kill the PDF */ public void closesPDF(){ { String[] dialog = new String[] { &quot;src\\test\\resources\\KillAcroRd32.bat&quot;}; try { Process p = Runtime.getRuntime().exec(dialog); System.out.println(p.getErrorStream().toString()); System.out.println(p.getInputStream().toString()); System.out.println(p.getOutputStream().toString()); System.out.println(&quot;After execution&quot;); } catch (IOException e) { // TODO Auto-generated catch block System.out.println(&quot;In the exception&quot;); e.printStackTrace(); throw new AssertionError(&quot;No Dialogue box displayed&quot;); } } }
  • 24. Easy to read Natural language automation Simple easy to read language POM. @testinggeek www.TestingGeek.com
  • 25. Componentise your automation @testinggeek www.TestingGeek.com
  • 26. Add dynamism... Connecting to the databses… @testinggeek www.TestingGeek.com
  • 27. @testinggeek www.TestingGeek.com All this is less effective if automation does not run automatically......
  • 28. Integrate with CI tools @testinggeek www.TestingGeek.com Mavenise your automation... And integrate them with Hudson...
  • 29. Distribute the Tests @testinggeek www.TestingGeek.com With Selenium Grids or Hudson Slaves...
  • 30. Integrate with CI tools @testinggeek www.TestingGeek.com What about Selenium 2.0 ?..... Will my old selenium tests run in 2.0?
  • 31. Selenium 2.0 @testinggeek www.TestingGeek.com -Web Driver - Presentation redering etc.
  • 32. @testinggeek www.TestingGeek.com import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.RenderedWebElement; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class TestingGeek { public static void main(String[] args) throws Exception { // The Firefox driver supports javascript WebDriver driver = new FirefoxDriver(); // Go to the TestingGeek home page driver.get(&quot;http://www.testinggeek.com&quot;); // Enter the query string &quot;Cheese&quot; //WebElement query = driver.findElement(By.name(&quot;q&quot;)); WebElement menu= driver.findElement(By. id(&quot;menu27&quot;)); menu.click(); // query.sendKeys(&quot;Cheese&quot;); // Sleep until the div we want is visible or 5 seconds is over long end = System. currentTimeMillis() + 5000; while (System. currentTimeMillis() < end) { // Browsers which render content (such as Firefox and IE) // return &quot;RenderedWebElements&quot; // RenderedWebElement resultsDiv = (RenderedWebElement) driver.findElement(By.className(&quot;gac_m&quot;)); RenderedWebElement resultsDiv = (RenderedWebElement) driver.findElement(By. id(&quot;menu27&quot;)); // If results have been returned, // the results are displayed in a drop down. if (resultsDiv.isDisplayed()) { break; } } // And now list the suggestions //List<WebElement> allSuggestions = driver.findElements(By. xpath(&quot;//td[@class='gac_c']&quot;)); List<WebElement> menus = driver.findElements(By. xpath(&quot;//div/div/div/ul/li[2]/ul&quot;)); for (WebElement menu1 : menus) { System. out.println(menu1.getText()); } } }
  • 33. Thank You. Anand Ramdeo www.TestingGeek.com @testinggeek www.AtlantisSw.com [email_address] @testinggeek www.TestingGeek.com