49
T3 Test Automation 10/6/16 9:45 Automated Testing Using Selenium Presented by: Jin Reck Mutual of Omaha Insurance Brought to you by: 350 Corporate Way, Suite 400, Orange Park, FL 32073 8882688770 9042780524 [email protected] http://www.starwest.techwell.com/

Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

       T3  Test  Automation  10/6/16  9:45            

Automated  Testing  Using  Selenium  Presented  by:    

 

  Jin  Reck      

Mutual  of  Omaha  Insurance    

Brought  to  you  by:        

   

   

350  Corporate  Way,  Suite  400,  Orange  Park,  FL  32073    888-­‐-­‐-­‐268-­‐-­‐-­‐8770  ·∙·∙  904-­‐-­‐-­‐278-­‐-­‐-­‐0524  -­‐  [email protected]  -­‐  http://www.starwest.techwell.com/      

 

       

Page 2: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Jin  Reck      A  lead  testing  engineer  at  Mutual  of  Omaha,  Jin  Reck  has  diverse  global  experience  with  multiple  Fortune  500  companies  within  the  technology,  telecommunications,  and  financial  domains.  Jin  spearheads  test  automation  for  Mutual  of  Omaha  by  developing  advanced  frameworks  that  emphasize  reusability  and  reduce  maintenance  efforts.  She  is  currently  responsible  for  strategic  delivery  of  client  engagements  for  QA/test  process  improvement,  test  automation  architecture,  test  development,  and  implementation.  Jin  specializes  in  delivering  testing  services  for  mobile  and  web  solutions,  test  automation,  and  load  and  performance  testing.  She  implements  automation  solutions  for  clients  using  both  commercial  and  open  source  tools.    

Page 3: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

STARWEST

2016

Page 4: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

About the Presenter • Jin Reck

o Test engineer and web developer

• “You love tests?"

"Well, yeah. There are questions and

answers. True or false, multiple choice,

essay. What's not to love?”

― Nora Roberts, Tribute

Page 5: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Automated

Testing Using

Selenium

Page 6: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

We are here to talk about • Testing

• Automation – Selenium Grid, Jmeter

• Selenium

• Continuous Integration/Continuous

Delivery/DevOps - Jenkins, FisheyeCrucible

and Sonarqube

Page 7: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Testing Software • Software testing is a process used to identify

the correctness, completeness and quality

of developed computer software. It includes

a set of activities conducted with the intent

of finding errors in software so that it could

be corrected before the product is released

to the end users

Page 8: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Why is Testing Important? • Software testing is any activity aimed at

evaluating an attribute or capability of a

program or system and determining that it

meets its required results

• Although crucial to software quality and

widely deployed by programmers and

testers, software testing still remains an art,

due to limited understanding of the

principles of software

Page 9: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Why is Testing Important? • Software bugs can be very expensive and

Dangerous

• Software testing is important to deliver the

best possible application

• Current Methods:

oManual

o 3rd Party Vendor Application

Page 10: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Testing - Impact • We need an optimal amount of testing

based on the risk assessment of the

application

• Testing either too much or too little could be

costly for the company

• We need an optimal amount of testing

based on the risk assessment of the

application--over-testing or under-testing

are not recommended

Page 11: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Automation • The difficulty with software testing stems from

the complexity of software:

oWe can not completely test a program

with moderate complexity. Testing is more

than just debugging.

o The purpose of testing can be quality

assurance, verification and validation, or

reliability estimation. Testing can be used

as a generic metric as well.

Page 12: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Automation o User Interface testing

• Simulate user actions

o Functional testing

• Create regression tests to verify

functionality and user acceptance

o Browser compatibility testing

• The same script can run on any

Selenium platform

o Load testing

o Stress testing

Page 13: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Manual test VS Automated

test

Page 14: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 15: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 16: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 17: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 18: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Automation - Why • There are many different devices, browsers,

and operating systems that could behave

differently when our websites/applications

are run on them

• Testing on multiple devices, browsers,

operating systems can help ensure our

website works for as many users as possible

Page 19: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Automation - Why • Web apps usually deal with sensitive info,

e.g.

oCredit card numbers

o SSNs

o Billing / Shipping addresses

• Security one of the biggest concerns

• Security testing should simulate possible

attacks

Page 20: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Automation - Impact • There’s always a chance that a user will do

what you least expect – no matter how unlikely it seems

• Testing can uncover bugs, the tricky part is figuring out where fixing bugs falls among project management priorities

• Software testing is a trade-off between budget, time and quality

Page 21: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Automation - Impact • Software testing is important to deliver the

best possible application

• We owe it to our users and ourselves to deliver the best applications possible

• Ultimately, we need software testing to ensure our websites or apps are something we can be proud of and have confidence in

Page 22: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Automation - Impact • Performance is crucial to the success of a

web application

• Performance testing evaluates system

performance under normal and heavy

usage

• Performance testing can be automated

Page 23: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

What is Selenium • What is selenium

• Chemical symbol - Se

• Atomic number - 34

• Atomic mass – 78.96

• Melting point – 428.9F

• Element classification – Non-Metal

• Crystal structure - Hexagonal

Page 24: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Selenium • Jason Huggins and team from ThoughtWorks

Inc. developed the testing tool in 2004

• Huggins joked about competitor HP Mercury

tools saying to cure mercury poisoning by

taking selenium supplements

Page 25: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Selenium • Selenium is an open source bowser based

test automation software

• Selenium is a robust suite of tools which

supports rapid development of test

automation for web-based applications

• Works anywhere Java script is supported

• Hooks for many other languages – Java,

Ruby, python

Page 26: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Selenium • Selenium:

o Extensible framework

o Supports mobile testing Android/IOS

oCan write test cases using language of

choice Java, C#, Python, Ruby & HTML

o Supports native browser testing

Page 27: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

• Selenium is a tool set that automates web application testing across platforms

• Selenium can simulate user interactions in a browser

• Functional testing

• Create regression tests to verify functionality and user acceptance

• Browser compatibility testing

• The same script can run on any Selenium platform

Page 28: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

• Firefox extension

• Easy record and replay

• Debug and set breakpoints

• Save tests in HTML,

Web driver and other

formats.

Page 29: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

• Selenium saves all information in an HTML table format

• Each record consists of:

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

o Target – tells Selenium which HTML element a command refers to (e.g. textbox, header, table)

o Value – used for any command that might need a value of some kind (e.g. type something into a textbox)

Page 30: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

• Selenium-Web driver

o Control the browser by programming

o More flexible and powerful

• Selenium-Web driver supports multiple browsers in multiple platforms

o Google Chrome 12.0.712.0+

o Internet Explorer 6+

o Firefox 3.0+

o Opera 11.5+

o Android – 2.3+ for phones and tablets

o iOS 3+ for phones

o iOS 3.2+ for tablets

Page 31: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Pros of Selenium • Possible to move testing from QA to Dev team

as part of unit testing

• Integration with most Continuous Integration systems

• Easy to integrate test with development language

• More control over the framework because of language choices

• Possible to implement scalable testing using the cloud/grid

• Faster execution

Page 32: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Cons of Selenium • IE driver uses JavaScript simulated XPATH

• Scripts working in Firefox and Chrome may not work in IE without some additional code

• No tools like Data Table for data driving test

• No Object Repository to store object mappings

• No object types in Selenium. Only Web Element and Select

• Table and other common HTML elements need extra code to work

• Different browsers may exhibit different issues on operations

• Higher development effort for initial few months

• NOTE: Many of these Cons are more of minor technical inconveniences than true “Cons”

Page 33: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Selenium How

Page 34: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Selenium How

Page 35: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

DevOps The DevOps approach seeks to meld

application development and deployment

into a more streamlined process, shifting some

of the operation team’s responsibilities back to

the development team in order to facilitate:

continuous development, continuous

integration, continuous delivery and

continuous monitoring processes

Page 36: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

• Continuous Integration basically just means

that the developer's working copies are

synchronized with a shared mainline several

times a day

Page 37: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

• Continuous Delivery is described as the

logical evolution of continuous integration:

Always be able to put a product into

production

Page 38: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

• Continuous Deployment is described as the

logical next step after continuous delivery:

Automatically deploy the product into

production whenever it passes QA

Page 39: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 40: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 41: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 42: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 43: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 44: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 45: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 46: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser
Page 47: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Review • Testing

• Automation – Selenium Grid, Jmeter

• Selenium

• Continuous Integration/Continuous

Delivery/DevOps - Jenkins, FisheyeCrucible

and Sonarqube

• Review

Page 48: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Questions?

Page 49: Automated!TestingUsingSelenium! - StickyMinds•Selenium is a tool set that automates web application testing across platforms •Selenium can simulate user interactions in a browser

Thank you