SlideShare una empresa de Scribd logo
1 de 13
www.mindqonline.com


How Selenium Remote Control works






You launch a server on your test machine.
Your tests connect to that server via IP
.
The server launches a browser, with selenium CORE
embedded as javascript into the page.
Selenium CORE simulates user actions with javascript.

www.mindqonline.com
The Bad

The Good










Doesn’t steal your
mouse/keyboard.
Works with any browser that
uses javascript
Works for any OS that
supports java.
Very fast page interactions.
Large API
Supports a variety of
programming languages.
Can be run on remote
machines
www.mindqonline.com

Can’t see anything
outside the page object.
 Not all browsers support
all functionality.
 Some pages aren’t
automatable.
 Can’t see inside third
party apps
 XSS Limitations

A

different way of automating the browser.

 Create

a browser-specific driver to control the
browser directly.
 Have to do this for each browser!
 Object

oriented API
 Doesn’t need a real browser
 No javascript limitations
 No need for a server.
 Isn’t as delicate as selenium.

www.mindqonline.com
 Went

into Beta Dec 24th.
 Web Driver + Selenium
 The

two projects have merged (literally) into
Selenium 2.0
 Large browser support and no javascript
limitations.
 No server
 The old API’s are still available.
 New API’s are becoming available.

www.mindqonline.com
 You


IWebDriver






have 2 options:

This is just the WebDriver api
Doesn’t support a lot of browsers.
Will need to change all your tests.

WebDriverBackedSelenium




Uses the old Selenium 1 API
But uses WebDriver to run things if possible
Can use selenium 1 if the browser isn’t supported.

www.mindqonline.com



Object Oriented
Doesn’t break nearly as often





Handles pageloads automatically
Fewer problems automating

Somewhat more complicated API


selenium.type(“password”,”thisIsMyPassword”);



driver.findElement(By.id("password")).sendKeys(“thisIsMyPassword");







By.Id, By.Xpath, By.Name, By.ClassName, By.PartialLinkText

All the supported browsers work really well
Can extend the API to add custom functionality.
Works well with a Page Object design model.

www.mindqonline.com












Adds a layer of abstraction into your code.
Helps to organize your code once it grows large.
All automation is automatically reusable and shareable.
A way to separate tests from re-usable functions.
A way to store information about how the system works.
A way to specify what page functions start on, and what
page they end on.
A way to programmatically break your tests when
functionality changes.
Makes code maintenance easier.
There is even a PageFactory class available to
automatically create them.

www.mindqonline.com














Each page is defined as it’s own class.
Actions (including navigation) are represented as functions for a class.
Each function returns a new Page object, signifying what page the actions
stops on.
Your tests “know” what page you are on, and will only give you access to
functions available to that class.
Tests only talk to the page objects.
Page objects only talk to the driver.
Elements on the page are stored as variables for the page object.
Automatic page validations can be stored in the constructor for each
page object.
Tests become a string of well defined functions, not meaningless
gibberish.
Tests can be grouped by namespace.
Class Inheritance can be used to define functionality to a set of pages.
We can make functional logic transparent to the tests by returning
different inherited classes.

www.mindqonline.com
globalVars.logDescription = "log in";
globalVars.selenium.Open(globalVars.mobiUrl);
functions.type("userId", globalVars.studName + "1");
functions.type("password", globalVars.studPass + "1");
functions.clickAndWait("signInBtn");
selenium.click("//a[@id='discussions']/span");
selenium.click("//a[@id='thingsToKnow']/span");
globalVars.logDescription = "Checking elements on happenings:by date page";

selenium.waitForElementNotVisible("//div[@id='THSContainer']//span[@class='ajaxLoadingHeader']");
selenium.waitForElementVisible("//div[@id='THSContainer']/ul[1]/li[1]");
selenium.click("//div[@id='THSContainer']//span[@class='replytext']");
selenium.click("backButton");
selenium.waitForElementVisible("//div[@id='TTHContainer']/ul[1]/li[1]");
selenium.click("//div[@id='TTHContainer']//span[@class='replytext']");
selenium.click("backButton");

globalVars.selenium.Select("byDateFilter", "label=Things Happening Soon");
selenium.waitForElementVisible("//div[@id='THSContainer']/ul[1]/li[1]");
selenium.click("//div[@id='THSContainer']//span[@class='replytext']");
selenium.click("backButton");
globalVars.selenium.Select("byDateFilter", "label=Things That Happened");

www.mindqonline.com
[Test]

public void testByDateTab()
{
funtions.loginMobi();
selenium.click("//a[@id='discussions']/span");
selenium.click("//a[@id='thingsToKnow']/span");
functions.verifyThingsToKnow();
functions.verifyThingsHappeningSoon();
selenium.Select("byDateFilter", "label=Things That Happened");
functions.verifyThingsThatHappened();
}

www.mindqonline.com
[Test]
public void testByDateTab()
{
selenium.Open(Moby_Common.MobyLoginUrl);
LoginPage loginPage = new LoginPage(selenium);
HappeningsPage happeningsPage = loginPage.loginAs(Common.stud1Name, Common.stud1Password);
happeningsPage.waitToLoad();

Assert.That(!happeningsPage.isByTypePageLoaded());
Assert.That(happeningsPage.isByDatePageLoaded());
Assert.That(!happeningsPage.isByCoursePageLoaded());
happeningsPage.filterResults("byDateFilter","Things That Happened");
Assert.That(happeningsPage.isVisible("TTHContainer"));
happeningsPage.filterResults("byDateFilter", "Things Happening Soon");
Assert.That(happeningsPage.isVisible("THSContainer"));

happeningsPage.filterResults("byDateFilter", "All Types");
Assert.That(happeningsPage.isVisible("TTHContainer"));
Assert.That(happeningsPage.isVisible("THSContainer"));
}

www.mindqonline.com
public class HappeningsPage : WebPageBaseClass
{

public ContentItemPage goToItem(string type,
string name)
{

private string _loadingImage =
"//span[@class='ajaxLoadingHeader']";

click("//div[@id='" + type +
"']//span[text()="" + name + ""]");

private string _moreLink = "more";

return new ContentItemPage(selenium);
}

public HappeningsPage(ISelenium selenium)

public HappeningsPage clickMoreLink()

{

{

this.selenium = selenium;

click(_moreLink);

this.title = "Happenings";

return new HappeningsPage(selenium);

this.url = "index.html";

}

assertPageLoadedCorrectly();
}

public HappeningsPage filterResults(string id,
string name)

public HappeningsPage waitToLoad()

{

{

selectDropdown(id, name);

waitForElementNotVisible(_loadingImage );

return new HappeningsPage(selenium);

return new HappeningsPage(selenium);
}

}
}

www.mindqonline.com

Más contenido relacionado

La actualidad más candente

Introduction to Selenium IDE
Introduction to Selenium IDEIntroduction to Selenium IDE
Introduction to Selenium IDEdrnikki
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriverAnuraj S.L
 
Test automation using selenium presented by Quontra Solutions
Test automation using selenium presented by Quontra SolutionsTest automation using selenium presented by Quontra Solutions
Test automation using selenium presented by Quontra SolutionsQUONTRASOLUTIONS
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectKnoldus Inc.
 
Selenium introduction and some feautures
Selenium introduction and some feauturesSelenium introduction and some feautures
Selenium introduction and some feautureszahid32
 
Automation Using Selenium Webdriver
Automation Using Selenium WebdriverAutomation Using Selenium Webdriver
Automation Using Selenium WebdriverEdureka!
 
Continuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriverContinuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriverAOE
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by steppriya Nithya
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Edureka!
 
Designing an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkDesigning an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkAndrea Tino
 
Selenium webcrawler
Selenium webcrawlerSelenium webcrawler
Selenium webcrawlerRabia Khalid
 
Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)Mehdi Khalili
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingAgile Testing Alliance
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testingAdam Siton
 

La actualidad más candente (20)

Selenium Automation
Selenium AutomationSelenium Automation
Selenium Automation
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Introduction to Selenium IDE
Introduction to Selenium IDEIntroduction to Selenium IDE
Introduction to Selenium IDE
 
Selenium drivers
Selenium driversSelenium drivers
Selenium drivers
 
Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
 
Selenium Overview
Selenium OverviewSelenium Overview
Selenium Overview
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
 
Test automation using selenium presented by Quontra Solutions
Test automation using selenium presented by Quontra SolutionsTest automation using selenium presented by Quontra Solutions
Test automation using selenium presented by Quontra Solutions
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
 
Selenium introduction and some feautures
Selenium introduction and some feauturesSelenium introduction and some feautures
Selenium introduction and some feautures
 
Automation Using Selenium Webdriver
Automation Using Selenium WebdriverAutomation Using Selenium Webdriver
Automation Using Selenium Webdriver
 
Continuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriverContinuous Quality Assurance using Selenium WebDriver
Continuous Quality Assurance using Selenium WebDriver
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by step
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
 
Designing an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkDesigning an effective hybrid apps automation framework
Designing an effective hybrid apps automation framework
 
Selenium webcrawler
Selenium webcrawlerSelenium webcrawler
Selenium webcrawler
 
Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)Automated UI Testing Done Right (QMSDNUG)
Automated UI Testing Done Right (QMSDNUG)
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
 
Automating UI testing
Automating UI testingAutomating UI testing
Automating UI testing
 

Similar a Automating with selenium2

Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsQuontra Solutions
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
 
Web driver selenium simplified
Web driver selenium simplifiedWeb driver selenium simplified
Web driver selenium simplifiedVikas Singh
 
Moving from selenium to protractor for test automation
Moving from selenium to protractor for test automationMoving from selenium to protractor for test automation
Moving from selenium to protractor for test automationZoe Gilbert
 
Progressive EPiServer Development
Progressive EPiServer DevelopmentProgressive EPiServer Development
Progressive EPiServer Developmentjoelabrahamsson
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presentedVijayan Reddy
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Atirek Gupta
 
Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalorerajkamal560066
 
An introduction to PhantomJS: A headless browser for automation test.
An introduction to PhantomJS: A headless browser for automation test.An introduction to PhantomJS: A headless browser for automation test.
An introduction to PhantomJS: A headless browser for automation test.BugRaptors
 
Appium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | EdurekaAppium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | EdurekaEdureka!
 
Effective testing of rich internet applications
Effective testing of rich internet applicationsEffective testing of rich internet applications
Effective testing of rich internet applicationsRashwin
 
Javascript spaghetti stirtrek_5_17
Javascript  spaghetti stirtrek_5_17Javascript  spaghetti stirtrek_5_17
Javascript spaghetti stirtrek_5_17Jared Faris
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Lookrumsan
 

Similar a Automating with selenium2 (20)

Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra Solutions
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
Web driver selenium simplified
Web driver selenium simplifiedWeb driver selenium simplified
Web driver selenium simplified
 
Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
 
Moving from selenium to protractor for test automation
Moving from selenium to protractor for test automationMoving from selenium to protractor for test automation
Moving from selenium to protractor for test automation
 
Node.js
Node.jsNode.js
Node.js
 
Protractor overview
Protractor overviewProtractor overview
Protractor overview
 
Progressive EPiServer Development
Progressive EPiServer DevelopmentProgressive EPiServer Development
Progressive EPiServer Development
 
Qa process
Qa processQa process
Qa process
 
Qa process
Qa processQa process
Qa process
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presented
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
 
Selenium Testing Training in Bangalore
Selenium Testing Training in BangaloreSelenium Testing Training in Bangalore
Selenium Testing Training in Bangalore
 
An introduction to PhantomJS: A headless browser for automation test.
An introduction to PhantomJS: A headless browser for automation test.An introduction to PhantomJS: A headless browser for automation test.
An introduction to PhantomJS: A headless browser for automation test.
 
Appium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | EdurekaAppium Interview Questions and Answers | Edureka
Appium Interview Questions and Answers | Edureka
 
Effective testing of rich internet applications
Effective testing of rich internet applicationsEffective testing of rich internet applications
Effective testing of rich internet applications
 
Page object pattern
Page object patternPage object pattern
Page object pattern
 
Javascript spaghetti stirtrek_5_17
Javascript  spaghetti stirtrek_5_17Javascript  spaghetti stirtrek_5_17
Javascript spaghetti stirtrek_5_17
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Look
 

Último

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 

Último (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

Automating with selenium2

  • 2.  How Selenium Remote Control works     You launch a server on your test machine. Your tests connect to that server via IP . The server launches a browser, with selenium CORE embedded as javascript into the page. Selenium CORE simulates user actions with javascript. www.mindqonline.com
  • 3. The Bad The Good        Doesn’t steal your mouse/keyboard. Works with any browser that uses javascript Works for any OS that supports java. Very fast page interactions. Large API Supports a variety of programming languages. Can be run on remote machines www.mindqonline.com Can’t see anything outside the page object.  Not all browsers support all functionality.  Some pages aren’t automatable.  Can’t see inside third party apps  XSS Limitations 
  • 4. A different way of automating the browser.  Create a browser-specific driver to control the browser directly.  Have to do this for each browser!  Object oriented API  Doesn’t need a real browser  No javascript limitations  No need for a server.  Isn’t as delicate as selenium. www.mindqonline.com
  • 5.  Went into Beta Dec 24th.  Web Driver + Selenium  The two projects have merged (literally) into Selenium 2.0  Large browser support and no javascript limitations.  No server  The old API’s are still available.  New API’s are becoming available. www.mindqonline.com
  • 6.  You  IWebDriver     have 2 options: This is just the WebDriver api Doesn’t support a lot of browsers. Will need to change all your tests. WebDriverBackedSelenium    Uses the old Selenium 1 API But uses WebDriver to run things if possible Can use selenium 1 if the browser isn’t supported. www.mindqonline.com
  • 7.   Object Oriented Doesn’t break nearly as often    Handles pageloads automatically Fewer problems automating Somewhat more complicated API  selenium.type(“password”,”thisIsMyPassword”);  driver.findElement(By.id("password")).sendKeys(“thisIsMyPassword");     By.Id, By.Xpath, By.Name, By.ClassName, By.PartialLinkText All the supported browsers work really well Can extend the API to add custom functionality. Works well with a Page Object design model. www.mindqonline.com
  • 8.          Adds a layer of abstraction into your code. Helps to organize your code once it grows large. All automation is automatically reusable and shareable. A way to separate tests from re-usable functions. A way to store information about how the system works. A way to specify what page functions start on, and what page they end on. A way to programmatically break your tests when functionality changes. Makes code maintenance easier. There is even a PageFactory class available to automatically create them. www.mindqonline.com
  • 9.             Each page is defined as it’s own class. Actions (including navigation) are represented as functions for a class. Each function returns a new Page object, signifying what page the actions stops on. Your tests “know” what page you are on, and will only give you access to functions available to that class. Tests only talk to the page objects. Page objects only talk to the driver. Elements on the page are stored as variables for the page object. Automatic page validations can be stored in the constructor for each page object. Tests become a string of well defined functions, not meaningless gibberish. Tests can be grouped by namespace. Class Inheritance can be used to define functionality to a set of pages. We can make functional logic transparent to the tests by returning different inherited classes. www.mindqonline.com
  • 10. globalVars.logDescription = "log in"; globalVars.selenium.Open(globalVars.mobiUrl); functions.type("userId", globalVars.studName + "1"); functions.type("password", globalVars.studPass + "1"); functions.clickAndWait("signInBtn"); selenium.click("//a[@id='discussions']/span"); selenium.click("//a[@id='thingsToKnow']/span"); globalVars.logDescription = "Checking elements on happenings:by date page"; selenium.waitForElementNotVisible("//div[@id='THSContainer']//span[@class='ajaxLoadingHeader']"); selenium.waitForElementVisible("//div[@id='THSContainer']/ul[1]/li[1]"); selenium.click("//div[@id='THSContainer']//span[@class='replytext']"); selenium.click("backButton"); selenium.waitForElementVisible("//div[@id='TTHContainer']/ul[1]/li[1]"); selenium.click("//div[@id='TTHContainer']//span[@class='replytext']"); selenium.click("backButton"); globalVars.selenium.Select("byDateFilter", "label=Things Happening Soon"); selenium.waitForElementVisible("//div[@id='THSContainer']/ul[1]/li[1]"); selenium.click("//div[@id='THSContainer']//span[@class='replytext']"); selenium.click("backButton"); globalVars.selenium.Select("byDateFilter", "label=Things That Happened"); www.mindqonline.com
  • 12. [Test] public void testByDateTab() { selenium.Open(Moby_Common.MobyLoginUrl); LoginPage loginPage = new LoginPage(selenium); HappeningsPage happeningsPage = loginPage.loginAs(Common.stud1Name, Common.stud1Password); happeningsPage.waitToLoad(); Assert.That(!happeningsPage.isByTypePageLoaded()); Assert.That(happeningsPage.isByDatePageLoaded()); Assert.That(!happeningsPage.isByCoursePageLoaded()); happeningsPage.filterResults("byDateFilter","Things That Happened"); Assert.That(happeningsPage.isVisible("TTHContainer")); happeningsPage.filterResults("byDateFilter", "Things Happening Soon"); Assert.That(happeningsPage.isVisible("THSContainer")); happeningsPage.filterResults("byDateFilter", "All Types"); Assert.That(happeningsPage.isVisible("TTHContainer")); Assert.That(happeningsPage.isVisible("THSContainer")); } www.mindqonline.com
  • 13. public class HappeningsPage : WebPageBaseClass { public ContentItemPage goToItem(string type, string name) { private string _loadingImage = "//span[@class='ajaxLoadingHeader']"; click("//div[@id='" + type + "']//span[text()="" + name + ""]"); private string _moreLink = "more"; return new ContentItemPage(selenium); } public HappeningsPage(ISelenium selenium) public HappeningsPage clickMoreLink() { { this.selenium = selenium; click(_moreLink); this.title = "Happenings"; return new HappeningsPage(selenium); this.url = "index.html"; } assertPageLoadedCorrectly(); } public HappeningsPage filterResults(string id, string name) public HappeningsPage waitToLoad() { { selectDropdown(id, name); waitForElementNotVisible(_loadingImage ); return new HappeningsPage(selenium); return new HappeningsPage(selenium); } } } www.mindqonline.com