quality with selenium (rz)

80
7/23/2019 Quality With Selenium (RZ) http://slidepdf.com/reader/full/quality-with-selenium-rz 1/80  Automated Testing Web Testing using Selenium Prepared by : Rizwana Zahoor

Upload: naveed-ramzan

Post on 18-Feb-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 1/80

 Automated TestingWeb Testing using Selenium

Prepared by : Rizwana Zahoor

Page 2: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 2/80

Contact at : [email protected]

 About Miss Rizwana Zahoor

• Quality Assurance Analyst @ Intelligentsia (Ph # 7, Bahria) (2

• Ranked 1

st

 positon in Testathon Event for “Identifying the besvaluable bug” among 25 to 30 people Organized by FAST in C

with Knowledge Tester in August, 2015

• Obtained MS (SE) in the area of Software Engineering from SZA

• QA Trainer @ TrainingsPK

• Member of Pakistan Agile Development Society.

•  Attended several workshops and conferences via knowledge teand others.

• Research Area : Agile Software Development

Page 3: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 3/80

What to Automate???

Choosing an automation tool

Creating a testinginfrastructure for automation

Designing of test cases

Development of scripts

ExecutionAnalysis o

Sharing Maint

Page 4: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 4/80

Contact at : [email protected]

 Automation Testing

•  A process of writing a computer program to do testing t

would otherwise need to be done manually.

• Use of software to control the execution of tests.

• It is a development activity not a test activity.

Page 5: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 5/80Contact at : [email protected]

Mind Status

 Activity

Page 6: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 6/80Contact at : [email protected]

 Automation Required Why?

Reduced testing time.

Reduce QA cost.

Eliminate manual testing Errors.

Proof of adequate testing.

Consistent test data procedures ensures the process repeatabili

resource independence.

Page 7: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 7/80Contact at : [email protected]

 Automated Software Testing

For complete automated testing, all of the

following tasks should be automated:

• Test Path/Sequence Generation

• Test Data Generation• Test Oracle (Verdict) Generation

• Test Execution

Page 8: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 8/80Contact at : [email protected]

Identifying Test Sequences

What sequences of function calls to test?

 – Out of billions of possible function call sequences for a class,

Which call sequences to select?

 – Important Decision

* A number of heuristics can be used, e.g., – Important function sequences based on application logic

 – Data-flow sequences

 – Checking the use-case flows / Prototypes

 – Checking the misuse-cases (Data Validation)

Page 9: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 9/80Contact at : [email protected]

Identifying Test Data

What test data to execute?

Consider a program taking two integers as input

• Possible number of input combinations: 264 * 264 

Which combinations to test?

Decision can be based on test data generation strategies

 – To maximize code’s control flow coverage 

 – To maximize code’s data flow coverage Test based on

equivalence classes and boundaries.

Page 10: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 10/80

Contact at : [email protected]

Equivalence Class Portioning

• To reduce the number of test cases to a necessary minimum.

• To select the right test cases to cover all possible scenarios

Page 11: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 11/80

Contact at : [email protected]

Identify equivalence classes

• Input, output: clue from requirement

• Equivalence classes are of 2 types: valid and invalid• Ex: identify equivalence classes for this requirement “ if a 

pupil has total score >= 75, he will pass the exam, otherwise

will fail (total score is an integer)” 

Page 12: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 12/80

Contact at : [email protected]

Equivalence classes Test cases

• Define the test cases for both valid and Invalid Equivalence Clas

• Example: write test case for “ if a pupil has total score >= 75, he past the exam, otherwise will fail ”, using equivalence partitionin

Page 13: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 13/80

Contact at : [email protected]

Boundary Value Testing

Example:

• “ if a pupil has total score >= 75, he will pass theexam, otherwise will fail (total score must be

integer )”

Page 14: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 14/80

Contact at : [email protected]

Computing Test Oracle

How to obtain a test oracle (expected results)?

 – Computing test oracle can also be challenging

 – Simpler at unit testing level

 – Expected outputs are based on test data and is typically manually

Page 15: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 15/80

Contact at : [email protected]

 Automated Test Execution

How to execute test cases without manual intervention?

• A number of frameworks support automated test

execution

• Record and replay tools (e.g., for web applications) 

• xUnit framework tools (J-Unit, N-Unit)

Page 16: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 16/80

Contact at : [email protected]

Benefits of Automation

•   Reliable : Tests perform precisely the same operations each time

run, thereby eliminating human error

•   Repeatable : You can test how the software reacts under repeat

of the same operations.

•   Reusable : You can reuse tests on different versions of an applic

if the user interface changes.

•   Better Qual i ty Software : Rapid feedback to developers during t

development process as a result of frequent regression testing.•   Speed : Run tests significantly faster than human users.

•   Cost Reduc t ion : As the number of resources for regression test

reduced.

Page 17: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 17/80

Contact at : [email protected]

Categories of Automated Testing Too

Record & Replay

 – Web application testing

 – GUI testing

 – Mobile Application Testing

 – xUnit Testing

 – Junit

 – Google Test – Nunit

 – Non-Functional Testing, e.g., Load

Testing

 – Load Runner

Record & Replay Tools

• Selenium

• Sahi

• Test Complete

• Watir

• QTP (Quick Test Profe

• QF-Test

Page 18: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 18/80

Contact at : [email protected]

Selenium

Web Testing Using Selenium

Page 19: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 19/80

Contact at : [email protected]

Testing with Selenium IDE

Introduction to Selenium

Recording Test scripts

Utilization of Recorded Scripts in Java

 Assertion for multiple Test Cases / Scenarios on single page

Selecting Page elements

Debugging Tests

Creating Test Suits and Saving them for later use.

Page 20: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 20/80

Contact at : [email protected]

Who developed?

Primarily, Selenium was created by Jason Huggins in 2004. An e

Thought Works, he was working on a web application that required

testing. Having realized that the repetitious manual testing of their a

was becoming more and more inefficient, he created a JavaScript p

would automatically control the browser's actions. He named this pr

the "JavaScriptTestRunner .“ 

Seeing potential in this idea to help automate other web applicationJavaScript Runner open-source which was later re-named as Selen

http://www.guru99.com/introduction-to-selenium.html 

Page 21: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 21/80

Contact at : [email protected]

Why Selenium ?

Best Option in Open source

Popularity Increasing

Works for GUI and Functionality

 Also can do Unit Testing

Page 22: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 22/80

Contact at : [email protected]

Selenium Automation Testing

What are components?

Selenium IDE (Integrated Development Environment )

Selenium Remote Control (RC)

WebDriver

Selenium Grid

The scope of training focuses on

Selenium IDE and Web driver.

Selenium C

Page 23: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 23/80

Contact at : [email protected]

 Arrival of Selenium 2

Page 24: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 24/80

Contact at : [email protected]

Selenium Test Packages

Selenium IDE – A Firefox extension to record test cases and suit

Selenium RC – Used to run tests on different browsers and syste

Selenium Grid – Runs multiple instances of Selenium RC at once

Page 25: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 25/80

Contact at : [email protected]

Selenium IDE

1. Recording play back tool.

2. It is a plugin to Fire fox browser.

3. It will support only FF (browser); no other browsers are supported.4. There is no any scripting language used to write a program.

5. HTML based script.

6. Can be used by developers with little to no programming experience to w

tests quickly and gain familiarity with the Selenese commands.

7. Has a recording feature that records a user’s live actions that can be expo

of many programming languages.

8. After recording the selenium IDE we can transfer or format the different lalike Java , C# , Rubby, Python & Perl.

9. Developed tests can be run against other browsers, using a simple

command-line interface that invokes the Selenium RC server.

10. Can export WebDriver or Remote Control scripts

Page 26: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 26/80

Contact at : [email protected]

Pros & Cons of Selenium IDE

Page 27: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 27/80

Contact at : [email protected]

 Activity

Installing Selenium

Page 28: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 28/80

Contact at : [email protected]

Is Fire fox Installed?

Click on the Mozilla Firefox

• Go to Help -> About as shown below:

• Check the version name

• What is your version?

Page 29: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 29/80

Contact at : [email protected]

To check Is Selenium Installed?

Page 30: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 30/80

Contact at : [email protected]

Is Selenium IDE Installed?

• Open the Firefox browser window (*1)

• Go to Tools -> Check whether Selenium IDE already exist there (*2)

• If you see “Selenium IDE” then you already having Selenium • IDE plug-in installed in Firefox browser.

• If not installed then follow the instruction on the next slide.

Page 31: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 31/80

Contact at : [email protected]

Installing Selenium IDE

• Open the Firefox browser window

• In the navigation tool bar type the below URL:http://seleniumhq.org/download/ 

• Click the Download link next to Selenium IDE project name.

Page 32: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 32/80

Contact at : [email protected]

Installing FireBug

Firebug is one of the add-ons of Firefox.

• It is widely used to inspect HTML elements on a webpage.

• You can get Firebug from the following link: https://getfirebug.com

Page 33: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 33/80

Contact at : [email protected]

Firebug UI

Page 34: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 34/80

Contact at : [email protected]

Installing FirePath

Extension of Firebug

• Used to get XPath and CSS values of an HTML elementon a web page.

• You can download FirePath from the following location:

https://addons.mozilla.org/en-US/firefox/addon/FirePath/ 

Page 35: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 35/80

Contact at : [email protected]

Selenium IDE Basics

Page 36: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 36/80

Contact at : [email protected]

Selenium IDE Test cases

• Selenium saves all information in an HTML table

format:

Each record consists of:

 – Command – tells Selenium what to do (e.g. “open”, “type”, 

“click”, “verifyText”)  – Target – tells Selenium which HTML element a command

refers to (e.g. textbox, header, table)

 – Value – used for any command that might need a value of

some kind (e.g. type something into a textbox)

H d/ l i h l i IDE?

Page 37: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 37/80

Contact at : [email protected]

How to record/replay with selenium IDE?

1. Start recording in Selenium IDE

2. Execute scenario on running web application

3. Stop recording in Selenium IDE4. Verify / Add assertions

5. Replay the test.

Page 38: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 38/80

{1Exercise

Recording first script in Selenium

R di A A t t d T t

Page 39: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 39/80

Contact at : [email protected]

Recording An Automated Test

• Open Firefox browser

• Navigate to

http://hrm.seleniumminutes.com (*1)• Go to Tools à Selenium IDE (*2)

D T t

Page 40: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 40/80

Contact at : [email protected]

Demo Test

Make sure Record button is ON!

• Go to the Browser window• Login using (*2):

Login Name: admin

Password: Password

• Click Login button

D T t ( t 2)

Page 41: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 41/80

Contact at : [email protected]

Demo Test (part 2)

• Hold your mouse over “Welcome Admin” text 

• Right-click and select verifyText

• Click logout link

STOP recording

Page 42: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 42/80

Contact at : [email protected]

STOP recording

• Go to Selenium IDE.

• Stop Recording.

• Click the red button to stop recording.•  All your actions are recorded and displayed sequentially

under Command Table Tab.

What did we accomplish?

Page 43: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 43/80

Contact at : [email protected]

What did we accomplish?

R nning Seleni m A tomated Test case

Page 44: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 44/80

Contact at : [email protected]

Running Selenium Automated Test case

Interpreting colors

Page 45: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 45/80

Contact at : [email protected]

Interpreting colors

• If you see all the command line rows turn

Green color, then the test has passed.

• Light Green means the code executedwithout problems.

• Dark Green means the test result of the

command evaluated to true.

• If any part of the test failed it will be shown

with Red color.

Debugging

Page 46: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 46/80

Contact at : [email protected]

Debugging

Examine the result of the script.

Time is needed to validate the login information… 

The test must WAIT for the next web page to load

before proceeding

Editing

Page 47: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 47/80

Contact at : [email protected]

Editing

• Click the 3rd to last row

• Modify the command field

• Replace “click” with “clickAndWait” command 

Page 48: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 48/80

{2ExerciseRecording your first script in Selenium

Page 49: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 49/80

 Record a script for creating Gma

signup account. And see the resuby playing the recording. Submit y

results at :

[email protected]

Page 50: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 50/80

Contact at : [email protected]

Selenium GUI Interface

Page 51: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 51/80

Contact at : [email protected]

Page 52: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 52/80

Contact at : [email protected]

Page 53: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 53/80

Contact at : [email protected]

Page 54: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 54/80

Contact at : rizwana zahoor@gmail com

Page 55: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 55/80

Contact at : rizwana zahoor@gmail com

Selenium IDE GUI Log View

Page 56: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 56/80

Contact at : rizwana zahoor@gmail com

• Provides current test case execution details

• Contains each step processed result

• Failed step will have a red text• Log is filtered into four different categories:

* Debug – Debugging information

* Info – Execution information

* Error – Error Information (for failed test steps)

* Warn – Any warnings

Page 57: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 57/80

Contact at : rizwana zahoor@gmail com

File Menu à Export Test Case As… 

Page 58: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 58/80

Contact at : rizwana zahoor@gmail com

p

 Available for the following languages:

• HTML

• Java• C#

• Python

• Ruby

Perl and PHP formatters canbe added separately.

Page 59: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 59/80

Contact at : rizwana zahoor@gmail com

Options Menu > Locator Builders

Page 60: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 60/80

Contact at : rizwana zahoor@gmail com

Locators (Selenium)

Page 61: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 61/80

Contact at : rizwana zahoor@gmail com

1. ID

2. Name

3. X Path4. CSS

5. Tag Name

6. Link text

7. Partial Link Text

8. DOM : Java Script

Using by .name( )

Page 62: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 62/80

Contact at : rizwana zahoor@gmail com

Using by .Id( )

Page 63: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 63/80

Contact at : rizwana zahoor@gmail com

Using by .tagName( )

Page 64: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 64/80

Contact at : rizwana zahoor@gmail com

Using by .class ( )

Page 65: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 65/80

Contact at : rizwana zahoor@gmail com

Using by .link Text ( )

Page 66: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 66/80

Contact at : rizwana zahoor@gmail com

Using by .partial Link( )

Page 67: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 67/80

Contact at : rizwana zahoor@gmail com

Using by.X Path

Page 68: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 68/80

Contact at : rizwana zahoor@gmail com

There are two types of path

1- Absolute X path

2- Relative X path

Absolute X path:  starts from html body

.//*[@id=':0']/div/div/div/div/div/p

Relative X path: short from of absolute

.//*[@id='gmail-create-account']

Using by .cssSelector

Page 69: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 69/80

Contact at : [email protected]

Selenium Commands

Page 70: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 70/80

Contact at : [email protected]

1. Actions: It is used to perform the operations and interactions w

elements.

• Click• Click and Wait

• Select

• Type

• Check

• Open etc.

2. Assertions: It is used as check points. Check points are nothingmatch the expected result to actual result.

Web Driver tool

Page 71: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 71/80

Contact at : [email protected]

 Assertions can be of three types:

1. Assert: When assert is failed; the test will be aborted. If you aretest suite, the next state case will start.

2. Verify: When verify fails, the test will continue execution logging

3. Accessors: It will be used for storing values and elements.

Some commands are : Store , Store text etc

Selenium IDE Drawback

Page 72: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 72/80

Contact at : [email protected]

1. It won’t handle multiple windows. 

2. Alerts

3. Popups4. Loops

5. If Conditions

6. Parameterization (Data from excel file, xml file)

Selenium Commands

Page 73: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 73/80

Contact at : [email protected]

open: Opens a page using a URL.

click: Clicks the element/object on the page.

clickAndWait: Performs a click operation, and optionally waits for a new page to load.

verifyTitle: Verifies the expected title and continues to run if it fails.

assertTitle: Verifies an expected page title and stops the execution if it fails.

verifyTextPresent:  Verifies that the expected text is present somewhere on the page.

verifyElementPresent:  Verifies an expected UI element, as defined by its HTML tag.

verifyText: Verifies that the expected text and its corresponding HTML tag are present on the page.

waitForPageToLoad: Pauses execution until an expected new page loads.

waitForElementPresent: Pauses execution until an expected UI element, as defined by its HTML tag, is present on the

Page 75: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 75/80

Heuristic ( / hjʉ rɪstɨk / ; Greek: Εὑρίσ"find" or "discover") refers to

experience-based techniques forproblem solving, learning, and discothat find a solution which is notguaranteed to be optimal, but good

enough for a given set of goals. 

From: Wikipedia

TEST C SE DESIGN HEURISTICS

Page 76: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 76/80

• CRUD (Create, Read, Update, Delete)

• SFDiPOT (Structure, Function, Data, Interfaces, Platform, O

Time)

• HICCUPPS (History, Image, Comparable Products, Claimsneeds, Product, Purpose, Statutes)

• RCRCRC (Recent, Core, Risky, Configuration, Repaired, C

Draw a Test Case Diagram for your project by applying any

Heuristics?

Page 77: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 77/80

References

Page 79: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 79/80

Contact at : [email protected]

 Air University

Management

Prof Dr. Ehsan AhmedStudents

Mr. Majd-Uddin

Sr. Quality Manager @ Bentley Systems

Running most famous blog www. knowledgetester.org

FAQs

Page 80: Quality With Selenium (RZ)

7/23/2019 Quality With Selenium (RZ)

http://slidepdf.com/reader/full/quality-with-selenium-rz 80/80

Contact at : [email protected]