SlideShare ist ein Scribd-Unternehmen logo
1 von 42
 JavaScript framework that runs in your
web-browser
 Works anywhere JavaScript is supported
 Hooks for many other languages
 Java, Ruby, Python
 Can simulate a user navigating through
pages and then assert for specific marks
on the pages
 All you need to really know is HTML to
start using it right away
 Supports Cross Browser Testing. The Selenium
tests can be run on multiple browsers.
 Allows scripting in several languages like Java,
C#, PHP and Python.
 Assertion statements provide an efficient way
of comparing expected and actual results.
 Inbuilt reporting mechanism.
 You can use Selenium-Core and
customize everything
 But it is easier to just get a Firefox plug-in
“Selenium-IDE” that helps you “record”
test cases
 You can record how an app is being used
and then play back those recordings
followed by asserts
 Get everything at:
www.openqa.org/selenium/
 Selenium IDE
 Selenium Remote Control
 Selenium Grid
 Selenium IDE is an integrated development environment for
Selenium tests.
 It is implemented as a Firefox extension, and allows you to
record, edit, and replay the test in Firefox
 Selenium IDE allows you to save tests as HTML, Java, Ruby
scripts, or any other format
 It allows you to automatically add assertions to all the pages.
 Allows you to add selenese commands as and when
required
 Using Firefox, first, download the IDE from the
SeleniumHQ downloads page When downloading from
Firefox, you’ll be presented with the Window A. (See Next
Slide)
 Select Install Now. The Firefox Add-ons window pops up,
first showing a progress bar, and when the download is
complete, displays the Window B. (See Next Slide)
 Restart Firefox. After Firefox reboots you will find the
Selenium-IDE listed under the Firefox Tools menu.
Window A Window B
To run the Selenium-IDE, simply select it from the Firefox Tools menu. It opens as
follows with an empty script-editing window and a menu for loading, or creating new
test cases. (See Next Slide)
The root of
web
application you
want to test
The list of
actions in the
actual test
case to
execute
The log of the
events that were
executed,
including any
errors or warning
that may have
occurred
Execution
Commands
Try the test in
the Web based
TestRunner
Reference of the
currently selected
command
Record test
actions
Specify
commands,
including asserts
Selenium Options allow you to
Set The Text Encoding Format
Set the Default Page Time Out
Set The Base URL recording option
Adding Selenium Core and IDE
Extension
Add Automatic Page Title Assertions
There are also other options under
development
 Create test case to log into the gallery
 Create test case to log out of the gallery
Start Pixory
Connect to the Server
Go to the Login Screen
Hit the Record Button
Type in Username and Password IDE should update
Hit submit
Hit record
again to
stop
Add assertTextPresent and
type the text to search for
Hit play to make sure your
test is successful
 A Test Suite in
Selenium is just
an HTML file
that contains a
table of links to
tests
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Demo Test Suite</title>
</head>
<body>
<table id="suiteTable">
<tbody>
<tr><td>
<b>Demo Test Suite</b>
</td></tr>
<tr><td>
<a href="./testLogin.html">TestLogin</a>
</td></tr>
<tr><td>
<a href="./testLogout.html">Test Logout</a>
</td></tr>
</tbody>
</table>
</body>
</html>
 Selenium Core is a collection of JavaScript
and HTML with iFrames
 Due to security concerns Core must be
deployed within the same server as the
application being hosted
 The simplest way to run Pixory is to just run
the Java application and let it use its own server
 Problems using Core with Pixory
 Selenium IDE is a plug-in for Firefox and
thus can go around these restrictions
 We basically want to execute the test suite
using the Selenium IDE plug-in
TestRunner.html
chrome://selenium-
ide/content/selenium/TestRunner.html?baseURL=<BASE>&tes
t=file:///<TEST SUITE FILE>&auto=true
chrome://selenium-
ide/content/selenium/TestRunner.html?baseURL=http://loc
alhost:8081&test=file:///Users/ms333/projects/classes/r
unning/v_and_v/hw3/selenium/test/TestSuite.html&auto=tr
ue
Application
being tested
Test Cases
Steps of
the test
case
Execution
Control
Run All Tests
Run Selected
Test
Pause/Pla
y
Execution
Step
through
Execution
Control Speed
of Execution
Highlight
Elements in
the Execution
View the DOM
of the current
Page being
tested
Summary of
the Test
View the log
of the current
execution
 Execute Tests created inside the Firefox
TestRunner
 Open Firefox that has the IDE installed
 Open the base URL of the application to
record.
 Keep the application in a common base state.
 Go To Tools  Selenium IDE and the IDE will
be opened
 Now perform the operations on the application
as you are testing the application.
 Once you are done with the recording click on
the stop recording button and save the test case
through the file menu. By default it will be
saved as a selenese script (HTML format)
 Make sure the application is in the common
base state.
 Click on the run button. Here you can also
control the speed of the execution using the
toolbar
 Once the test is run you can view the test log in
the bottom of the IDE window
 In the Selenium IDE you
can create any number
of test cases and save
them as test suite.
 To Run the test Suite
click on the “Play entire
test suite” button as
shown below.
Test Suite with
Test1 & test2
 Test Runner allows you to run the test case in a browser
loaded with the Selenium-Core TestRunner.
 Test runner is invoked by clicking the below Shown
button in the IDE
On Clicking the Test Runner Button you will the window
as seen in the next slide
Softsmith Infotech
Click this button to run all the tests
 Run a Test Case
 Click the Run button to run the currently displayed test case.
 Run a Test Suite
 Click the Run All button to run all the test cases in the
currently loaded test suite.
 Stop and Start
 The Pause button can be used to stop the test case while it is
running. The icon of this button then changes to indicate the
Resume button. To continue click Resume.
 Stop in the Middle
 You can set a breakpoint in the test case to cause it to stop on
a particular command. This is useful for debugging your test
case. To set a breakpoint, select a command, right-click, and
from the context menu select Toggle Breakpoint.
 Start from the Middle
 You can tell the IDE to begin running from a
specific command in the middle of the test case. This
also is used for debugging. To set a start point, select
a command, right-click, and from the context menu
select Set/Clear Start Point.
 Run Any Single Command
 Double-click any single command to run it by
itself. This is useful when writing a single command.
It lets you immediately test a command you are
constructing, when you are not sure if it is correct.
You can double-click it to see if it runs correctly. This
is also available from the context menu.
 Selenese allows multiple ways of checking for
UI elements.
 Verifications and assertions are used to check if
an element is present somewhere on the page?
specific text is somewhere on the page?
specific text is at a specific location on the page?
 Verifications and assertions are not one and the
same.
 If an assertion fails, the script will be aborted
but if a verification fails the script will
continue.
verifyTextPresent
This command is used to
check if a particular text is
present in a page or not.
To add this command ,
While recording the test
steps right click on the text
item that you want verify.
Once right clicked you can
find an option “Show all
commands”. On Clicking it
you will find an option
“verifyTextPresent”, select it
verifyTitle
 This command is used to
check if the page title is
correct or not.
 To add this command ,
While recording the test
steps right click any where
on the page that you want
verify. Once right clicked
you can find an option
“Show all commands”. On
Clicking it you will find an
option “verifyTitle”, select
it
verifyElementPresent
 This command is used to
verify if a page element is
present in the page or not.
 To add this command ,
While recording the test
steps right click any
element on the page
that you want verify.
Once right clicked you
can find an option
“Show all commands”.
On Clicking it you will
find an option
“verifyElementPresent”,
select it
verifyValue
 This method is used to check
if edit box has particular
value or if the check box is
on. Basically this method
returns the value of present
in the object.
 To add this command , While
recording the test steps right
click any element on the page
that you want verify the
value of. Once right clicked
you can find an option
“Show all commands”. On
Clicking it you will find an
option “verifyValue”, select it.
 Assertions are same as Verifications. The
only difference is, if the assertions fail the
script will abort. But the script will continue
run in case a verification point fails.
 The steps for inserting the assertions is
same as that of verification point.
 While recording Right Click  Show all
commands  select an assertion.
 assertTextPresent
This will assert if the text is present in the page.
 assertText
This will assert if a particular element is having the particular text.
 assertTitle
This will assert if the page is having a proper title.
 assertValue
This will assert if a Text box or check box has a particular value
 assertElementPresent
This will assert if a particular UI Element is present in the page.
waitForPageToLoad
This command will make the script to wait till the page
loads.
Syntax is waitForPageToLoad(timeout); Time out is the
maximum time the script will wait for the page to load.
 waitForAlert
This command will wait for the alert message to appear
 waitForTable
This command will wait for the Web table to
completely load in the page
 waitForTitle
This command will for the page Title to appear on the
browser.
 Other waitFor commands
Selenium has several other wait command like
waitForText, waitForPopup and so on. These
commands are generically called Synchronization
commands
 Store command are used to fetch the values
from the application and store it in a variable.
These variables can be used latter for
validation purpose.
 The Store command can be used to retrieve the
page title, text from the page and other
attributes from the application.
 Echo command is
used to print the
value in to the
selenium IDS log.
 When printing a
variable use ${var}
 There are some
limitations for this
methods this has to
be used with caution
 Can run the test only on Firefox
 No Programming login (like loops, conditional
statements) can be applied
 Selenium IDE can execute scripts created in
Selenese only.
 It is difficult to use Selenium IDE for checking
complex test cases involving dynamic contents

Weitere ähnliche Inhalte

Was ist angesagt?

Selenium introduction and some feautures
Selenium introduction and some feauturesSelenium introduction and some feautures
Selenium introduction and some feautureszahid32
 
Mobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsMobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsSauce Labs
 
How to configure Appium with android IDE & eclipse
How to configure Appium with android IDE & eclipseHow to configure Appium with android IDE & eclipse
How to configure Appium with android IDE & eclipseHaitham Refaat
 
Selenium - Installation
Selenium - InstallationSelenium - Installation
Selenium - InstallationRajesh-QA
 
Selenium Installation
Selenium  InstallationSelenium  Installation
Selenium InstallationANKUR-BA
 
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01Aravindharamanan S
 
Selenium Ide Tutorials
Selenium Ide TutorialsSelenium Ide Tutorials
Selenium Ide Tutorialsgueste1e4db
 

Was ist angesagt? (15)

Selenium introduction and some feautures
Selenium introduction and some feauturesSelenium introduction and some feautures
Selenium introduction and some feautures
 
Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
 
Selenium tutorial
Selenium tutorialSelenium tutorial
Selenium tutorial
 
Selenium training in chennai
Selenium training in chennaiSelenium training in chennai
Selenium training in chennai
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Selenium
SeleniumSelenium
Selenium
 
Mobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsMobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason Huggins
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
How to configure Appium with android IDE & eclipse
How to configure Appium with android IDE & eclipseHow to configure Appium with android IDE & eclipse
How to configure Appium with android IDE & eclipse
 
Selenium - Installation
Selenium - InstallationSelenium - Installation
Selenium - Installation
 
Selenium Installation
Selenium  InstallationSelenium  Installation
Selenium Installation
 
Selenium IDE LOCATORS
Selenium IDE LOCATORSSelenium IDE LOCATORS
Selenium IDE LOCATORS
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
Softwaretestingtoolsfreeandopensourcefinal 150411221750-conversion-gate01
 
Selenium Ide Tutorials
Selenium Ide TutorialsSelenium Ide Tutorials
Selenium Ide Tutorials
 

Ähnlich wie Selenium

Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using seleniumjayeshvaghelaqa
 
Everything you need to know about the Selenium IDE: Tutorial
Everything you need to know about the Selenium IDE: TutorialEverything you need to know about the Selenium IDE: Tutorial
Everything you need to know about the Selenium IDE: TutorialpCloudy
 
Learn SELENIUM at ASIT
Learn SELENIUM at ASITLearn SELENIUM at ASIT
Learn SELENIUM at ASITASIT
 
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.
 
Software testing tools (free and open source)
Software testing tools (free and open source)Software testing tools (free and open source)
Software testing tools (free and open source)Wael Mansour
 
Selenium IDE and Extensions
Selenium IDE and ExtensionsSelenium IDE and Extensions
Selenium IDE and ExtensionsYana Altunyan
 
Introduction to Selenium
Introduction to SeleniumIntroduction to Selenium
Introduction to SeleniumKnoldus Inc.
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using JavaF K
 
Selenium training
Selenium trainingSelenium training
Selenium trainingRobin0590
 

Ähnlich wie Selenium (20)

Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
What is selenium
What is seleniumWhat is selenium
What is selenium
 
Everything you need to know about the Selenium IDE: Tutorial
Everything you need to know about the Selenium IDE: TutorialEverything you need to know about the Selenium IDE: Tutorial
Everything you need to know about the Selenium IDE: Tutorial
 
Selenium ide made easy
Selenium ide made easySelenium ide made easy
Selenium ide made easy
 
Sel
SelSel
Sel
 
Learn SELENIUM at ASIT
Learn SELENIUM at ASITLearn SELENIUM at ASIT
Learn SELENIUM at ASIT
 
Selenium Testing
Selenium Testing Selenium Testing
Selenium Testing
 
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
 
Software testing tools (free and open source)
Software testing tools (free and open source)Software testing tools (free and open source)
Software testing tools (free and open source)
 
Selenium IDE and Extensions
Selenium IDE and ExtensionsSelenium IDE and Extensions
Selenium IDE and Extensions
 
Introduction to Selenium
Introduction to SeleniumIntroduction to Selenium
Introduction to Selenium
 
Selenium (1) (1)
Selenium (1) (1)Selenium (1) (1)
Selenium (1) (1)
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using Java
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
 

Mehr von nil65

Software testing
Software testingSoftware testing
Software testingnil65
 
software testing on whatsapp
software testing on whatsappsoftware testing on whatsapp
software testing on whatsappnil65
 
Security
SecuritySecurity
Securitynil65
 
Software project management
Software project managementSoftware project management
Software project managementnil65
 
Wifi
WifiWifi
Wifinil65
 
multimedia mpeg-7
multimedia mpeg-7multimedia mpeg-7
multimedia mpeg-7nil65
 
Linux intro to advance
Linux intro to advanceLinux intro to advance
Linux intro to advancenil65
 
Dss
Dss Dss
Dss nil65
 

Mehr von nil65 (9)

Software testing
Software testingSoftware testing
Software testing
 
software testing on whatsapp
software testing on whatsappsoftware testing on whatsapp
software testing on whatsapp
 
Security
SecuritySecurity
Security
 
Software project management
Software project managementSoftware project management
Software project management
 
Wifi
WifiWifi
Wifi
 
multimedia mpeg-7
multimedia mpeg-7multimedia mpeg-7
multimedia mpeg-7
 
Linux intro to advance
Linux intro to advanceLinux intro to advance
Linux intro to advance
 
Gps
GpsGps
Gps
 
Dss
Dss Dss
Dss
 

Kürzlich hochgeladen

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Kürzlich hochgeladen (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

Selenium

  • 1.
  • 2.  JavaScript framework that runs in your web-browser  Works anywhere JavaScript is supported  Hooks for many other languages  Java, Ruby, Python  Can simulate a user navigating through pages and then assert for specific marks on the pages  All you need to really know is HTML to start using it right away
  • 3.  Supports Cross Browser Testing. The Selenium tests can be run on multiple browsers.  Allows scripting in several languages like Java, C#, PHP and Python.  Assertion statements provide an efficient way of comparing expected and actual results.  Inbuilt reporting mechanism.
  • 4.  You can use Selenium-Core and customize everything  But it is easier to just get a Firefox plug-in “Selenium-IDE” that helps you “record” test cases  You can record how an app is being used and then play back those recordings followed by asserts  Get everything at: www.openqa.org/selenium/
  • 5.  Selenium IDE  Selenium Remote Control  Selenium Grid
  • 6.  Selenium IDE is an integrated development environment for Selenium tests.  It is implemented as a Firefox extension, and allows you to record, edit, and replay the test in Firefox  Selenium IDE allows you to save tests as HTML, Java, Ruby scripts, or any other format  It allows you to automatically add assertions to all the pages.  Allows you to add selenese commands as and when required
  • 7.  Using Firefox, first, download the IDE from the SeleniumHQ downloads page When downloading from Firefox, you’ll be presented with the Window A. (See Next Slide)  Select Install Now. The Firefox Add-ons window pops up, first showing a progress bar, and when the download is complete, displays the Window B. (See Next Slide)  Restart Firefox. After Firefox reboots you will find the Selenium-IDE listed under the Firefox Tools menu.
  • 8. Window A Window B To run the Selenium-IDE, simply select it from the Firefox Tools menu. It opens as follows with an empty script-editing window and a menu for loading, or creating new test cases. (See Next Slide)
  • 9. The root of web application you want to test The list of actions in the actual test case to execute The log of the events that were executed, including any errors or warning that may have occurred
  • 10. Execution Commands Try the test in the Web based TestRunner Reference of the currently selected command Record test actions Specify commands, including asserts
  • 11. Selenium Options allow you to Set The Text Encoding Format Set the Default Page Time Out Set The Base URL recording option Adding Selenium Core and IDE Extension Add Automatic Page Title Assertions There are also other options under development
  • 12.  Create test case to log into the gallery  Create test case to log out of the gallery
  • 13. Start Pixory Connect to the Server Go to the Login Screen Hit the Record Button
  • 14. Type in Username and Password IDE should update Hit submit Hit record again to stop
  • 15. Add assertTextPresent and type the text to search for Hit play to make sure your test is successful
  • 16.  A Test Suite in Selenium is just an HTML file that contains a table of links to tests <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Demo Test Suite</title> </head> <body> <table id="suiteTable"> <tbody> <tr><td> <b>Demo Test Suite</b> </td></tr> <tr><td> <a href="./testLogin.html">TestLogin</a> </td></tr> <tr><td> <a href="./testLogout.html">Test Logout</a> </td></tr> </tbody> </table> </body> </html>
  • 17.  Selenium Core is a collection of JavaScript and HTML with iFrames  Due to security concerns Core must be deployed within the same server as the application being hosted  The simplest way to run Pixory is to just run the Java application and let it use its own server  Problems using Core with Pixory  Selenium IDE is a plug-in for Firefox and thus can go around these restrictions
  • 18.  We basically want to execute the test suite using the Selenium IDE plug-in TestRunner.html chrome://selenium- ide/content/selenium/TestRunner.html?baseURL=<BASE>&tes t=file:///<TEST SUITE FILE>&auto=true chrome://selenium- ide/content/selenium/TestRunner.html?baseURL=http://loc alhost:8081&test=file:///Users/ms333/projects/classes/r unning/v_and_v/hw3/selenium/test/TestSuite.html&auto=tr ue
  • 19.
  • 20. Application being tested Test Cases Steps of the test case Execution Control
  • 21.
  • 22. Run All Tests Run Selected Test Pause/Pla y Execution Step through Execution Control Speed of Execution Highlight Elements in the Execution View the DOM of the current Page being tested Summary of the Test View the log of the current execution
  • 23.  Execute Tests created inside the Firefox TestRunner
  • 24.  Open Firefox that has the IDE installed  Open the base URL of the application to record.  Keep the application in a common base state.  Go To Tools  Selenium IDE and the IDE will be opened  Now perform the operations on the application as you are testing the application.  Once you are done with the recording click on the stop recording button and save the test case through the file menu. By default it will be saved as a selenese script (HTML format)
  • 25.  Make sure the application is in the common base state.  Click on the run button. Here you can also control the speed of the execution using the toolbar  Once the test is run you can view the test log in the bottom of the IDE window
  • 26.  In the Selenium IDE you can create any number of test cases and save them as test suite.  To Run the test Suite click on the “Play entire test suite” button as shown below. Test Suite with Test1 & test2
  • 27.  Test Runner allows you to run the test case in a browser loaded with the Selenium-Core TestRunner.  Test runner is invoked by clicking the below Shown button in the IDE On Clicking the Test Runner Button you will the window as seen in the next slide
  • 28. Softsmith Infotech Click this button to run all the tests
  • 29.  Run a Test Case  Click the Run button to run the currently displayed test case.  Run a Test Suite  Click the Run All button to run all the test cases in the currently loaded test suite.  Stop and Start  The Pause button can be used to stop the test case while it is running. The icon of this button then changes to indicate the Resume button. To continue click Resume.  Stop in the Middle  You can set a breakpoint in the test case to cause it to stop on a particular command. This is useful for debugging your test case. To set a breakpoint, select a command, right-click, and from the context menu select Toggle Breakpoint.
  • 30.  Start from the Middle  You can tell the IDE to begin running from a specific command in the middle of the test case. This also is used for debugging. To set a start point, select a command, right-click, and from the context menu select Set/Clear Start Point.  Run Any Single Command  Double-click any single command to run it by itself. This is useful when writing a single command. It lets you immediately test a command you are constructing, when you are not sure if it is correct. You can double-click it to see if it runs correctly. This is also available from the context menu.
  • 31.  Selenese allows multiple ways of checking for UI elements.  Verifications and assertions are used to check if an element is present somewhere on the page? specific text is somewhere on the page? specific text is at a specific location on the page?  Verifications and assertions are not one and the same.  If an assertion fails, the script will be aborted but if a verification fails the script will continue.
  • 32. verifyTextPresent This command is used to check if a particular text is present in a page or not. To add this command , While recording the test steps right click on the text item that you want verify. Once right clicked you can find an option “Show all commands”. On Clicking it you will find an option “verifyTextPresent”, select it
  • 33. verifyTitle  This command is used to check if the page title is correct or not.  To add this command , While recording the test steps right click any where on the page that you want verify. Once right clicked you can find an option “Show all commands”. On Clicking it you will find an option “verifyTitle”, select it
  • 34. verifyElementPresent  This command is used to verify if a page element is present in the page or not.  To add this command , While recording the test steps right click any element on the page that you want verify. Once right clicked you can find an option “Show all commands”. On Clicking it you will find an option “verifyElementPresent”, select it
  • 35. verifyValue  This method is used to check if edit box has particular value or if the check box is on. Basically this method returns the value of present in the object.  To add this command , While recording the test steps right click any element on the page that you want verify the value of. Once right clicked you can find an option “Show all commands”. On Clicking it you will find an option “verifyValue”, select it.
  • 36.  Assertions are same as Verifications. The only difference is, if the assertions fail the script will abort. But the script will continue run in case a verification point fails.  The steps for inserting the assertions is same as that of verification point.  While recording Right Click  Show all commands  select an assertion.
  • 37.  assertTextPresent This will assert if the text is present in the page.  assertText This will assert if a particular element is having the particular text.  assertTitle This will assert if the page is having a proper title.  assertValue This will assert if a Text box or check box has a particular value  assertElementPresent This will assert if a particular UI Element is present in the page.
  • 38. waitForPageToLoad This command will make the script to wait till the page loads. Syntax is waitForPageToLoad(timeout); Time out is the maximum time the script will wait for the page to load.
  • 39.  waitForAlert This command will wait for the alert message to appear  waitForTable This command will wait for the Web table to completely load in the page  waitForTitle This command will for the page Title to appear on the browser.  Other waitFor commands Selenium has several other wait command like waitForText, waitForPopup and so on. These commands are generically called Synchronization commands
  • 40.  Store command are used to fetch the values from the application and store it in a variable. These variables can be used latter for validation purpose.  The Store command can be used to retrieve the page title, text from the page and other attributes from the application.
  • 41.  Echo command is used to print the value in to the selenium IDS log.  When printing a variable use ${var}  There are some limitations for this methods this has to be used with caution
  • 42.  Can run the test only on Firefox  No Programming login (like loops, conditional statements) can be applied  Selenium IDE can execute scripts created in Selenese only.  It is difficult to use Selenium IDE for checking complex test cases involving dynamic contents