15
T15 Test Automation 5/5/16 13:30 The Selenium Grid: Run Multiple Automated Tests in Parallel Presented by: Brian Long Virginia Tech Brought to you by: 350 Corporate Way, Suite 400, Orange Park, FL 32073 8882688770 9042780524 [email protected] http://www.stareast.techwell.com/

The Selenium Grid: Run Multiple Automated Tests in Parallel

Embed Size (px)

Citation preview

Page 1: The Selenium Grid: Run Multiple Automated Tests in Parallel

   

     T15  Test  Automation  5/5/16  13:30              

The  Selenium  Grid:  Run  Multiple  Automated  Tests  in  Parallel  

 Presented  by:  

 

Brian  Long  

Virginia  Tech    

Brought  to  you  by:        

   

   

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

 

Page 2: The Selenium Grid: Run Multiple Automated Tests in Parallel

       

Brian  Long  Virginia  Tech    Brian  Long  has  been  a  consultant  and  software  developer  for  more  than  thirty-­‐five  years.  Â  During  his  career  he  has  worked  in  the  fields  of  insurance,  utilities,  telecommunications,  and  higher  education  in  roles  ranging  from  developer  to  technical  lead  to  lead  architect.  He  joined  Virginia  Polytechnic  Institute  &  State  University  in  2005.  An  ASTQB  certified  tester,  Brian  currently  manages  Virginia  Tech's  quality  assurance  and  verification  department,  runs  the  university's  Selenium  Grid,  and  developed  some  of  the  open-­‐source  software  used  in  this  presentation.  Â      

   

Page 3: The Selenium Grid: Run Multiple Automated Tests in Parallel

Selenium Grid 101: Getting Up and Running with Custom Tests

Brian Long, Manager - Secure Identity Services Quality Assurance and Verification

Page 4: The Selenium Grid: Run Multiple Automated Tests in Parallel

Brian Long 101

• VT Grad (twice!)

• 30-ish years of software development

• 3-ish years as professional tester

• Manager of Quality Assurance & Verification for Virginia Tech’s Secure Identity Services

2

Page 5: The Selenium Grid: Run Multiple Automated Tests in Parallel

Selenium @ VT

• We support

• Windows (last three versions)

• IE, Ffox, Chrome, Edge

• MacOS (last three versions)

• Safari, Ffox, Chrome

• Linux (as-needed but not really)

• Ffox, Chrome

3

Page 6: The Selenium Grid: Run Multiple Automated Tests in Parallel

Selenium @ VT

• Best Case:

• 7 Unique Operating Systems

• 5 Unique Browsers

4

Page 7: The Selenium Grid: Run Multiple Automated Tests in Parallel

Selenium @ VT

Open-Source Selenium Grid Framework:

https://github.com/brianxlong/selenium-grid-setup

5

Page 8: The Selenium Grid: Run Multiple Automated Tests in Parallel

Selenium @ VT

Open-Source Selenium Grid Framework:

https://github.com/brianxlong/selenium-grid-setup

What does it do?

Provides Hub and Node Config

Provides Sample Test

6

Page 9: The Selenium Grid: Run Multiple Automated Tests in Parallel

How Do I Get it to Work?

RTFR! (Read the Fine ReadMe!)*

1. Put the grid-setup/hub directory on your

hub (if your hub is a windows box, you'll need

to rename the executable 'starthub' to

something like 'starthub.cmd' and fix the

link).

7

Page 10: The Selenium Grid: Run Multiple Automated Tests in Parallel

How Do I Get it to Work?

2. Put the appropriate grid-setup/*-node

directory/ies on your node/s along with the

selenium-server-standalone-<version>.jar

(if you change the version, change the links

in the startup scripts to match).

8

Page 11: The Selenium Grid: Run Multiple Automated Tests in Parallel

How Do I Get it to Work?

3. Update the JSON configs with the ip of your

hub and the ip of each of your nodes.

(search for *.json – there is one in each of

the *-node directories under selenium-grid-

setup\grid-setup, and named for the operating

system: e.g. nodeconfig-win81.json)

9

Page 12: The Selenium Grid: Run Multiple Automated Tests in Parallel

How Do I Get it to Work?

4. Run grid-setup/starthub on the hub

5. Run grid-setup/startnode-* on your nodes

Done! You have a grid. You can check the

connections from your browser at

http://localhost:4444/grid/console on your

hub machine

10

Page 13: The Selenium Grid: Run Multiple Automated Tests in Parallel

OK, Now What?

Run the Sample Test:

Nav to grid-test/helpers

Run isgridup.sh

11

Page 14: The Selenium Grid: Run Multiple Automated Tests in Parallel

OK, Now What?

Sample Test Results:

All nodes navigate to address specified in VerifyTest.java

12

Page 15: The Selenium Grid: Run Multiple Automated Tests in Parallel

OK, Now Now What?

Run Your Own Tests on the Grid: • Use Selenium IDE to generate Java code for your test

• Extend RemoteTest to integrate it into the grid OR just plug it into VerifyGrid.java

• Run your test on the grid

13