SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
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
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Dernier (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
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
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

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