Selenium Selenium Edward Cerullo www.thecamp.dk 2014 Selenium - - PowerPoint PPT Presentation

selenium selenium edward cerullo thecamp dk 2014 selenium
SMART_READER_LITE
LIVE PREVIEW

Selenium Selenium Edward Cerullo www.thecamp.dk 2014 Selenium - - PowerPoint PPT Presentation

Selenium Selenium Edward Cerullo www.thecamp.dk 2014 Selenium What is Selenium? What is Selenium? What is Selenium? What is Selenium? What is Selenium? Selenium is a non-metal with properties between Sulfur (S-above) and Tellurium


slide-1
SLIDE 1

Selenium

slide-2
SLIDE 2

Selenium Edward Cerullo www.thecamp.dk 2014

slide-3
SLIDE 3

Selenium

slide-4
SLIDE 4

What is Selenium?

slide-5
SLIDE 5

What is Selenium?

slide-6
SLIDE 6

What is Selenium?

slide-7
SLIDE 7

What is Selenium?

Selenium is a non-metal with properties between Sulfur (S-above) and Tellurium (Te-below).

What is Selenium?

slide-8
SLIDE 8

Why Selenium?

slide-9
SLIDE 9

Well, once upon a time, there was a testing application called Mercury...

slide-10
SLIDE 10

Well, once upon a time, there was a testing application called Mercury...

slide-11
SLIDE 11

Well, once upon a time, there was a testing application called Mercury...

slide-12
SLIDE 12

But Mercury was complex to use and very expensive...

slide-13
SLIDE 13

But Mercury was complex to use and very expensive...

slide-14
SLIDE 14

And then Mercury was bought by HP, and rebranded Quality Center.

slide-15
SLIDE 15

And then Mercury was bought by HP, and rebranded Quality Center. Want to guess how expensive it is now?

slide-16
SLIDE 16

Objectives

  • Navigate around in Selenium
  • Create some test cases manually
  • Create some test cases using the Record option
  • Group test cases together in a Test Suite
  • Look at Selenese
  • Add in JavaScript
  • Føniks Computer site
  • The Google
slide-17
SLIDE 17

There are two versions of Selenium:

slide-18
SLIDE 18

There are two versions of Selenium:

Selenium IDE

slide-19
SLIDE 19

There are two versions of Selenium:

Selenium IDE

slide-20
SLIDE 20

There are two versions of Selenium:

Selenium IDE Selenium WebDriver

slide-21
SLIDE 21

There are two versions of Selenium:

Selenium IDE Selenium WebDriver

slide-22
SLIDE 22

Selenium IDE

Interactive Development Environment for your

tests.

slide-23
SLIDE 23

Selenium IDE

Interactive Development Environment for your

tests.

Record tests and then play them back.

slide-24
SLIDE 24

Selenium IDE

Interactive Development Environment for your

tests.

Record tests and then play them back. Easy to select fields from pages.

slide-25
SLIDE 25

Selenium IDE

Interactive Development Environment for your

tests.

Record tests and then play them back. Easy to select fields from pages. Test step by step.

slide-26
SLIDE 26

Selenium IDE

Interactive Development Environment for your

tests.

Record tests and then play them back. Easy to select fields from pages. Test step by step. Debug mode with breakpoints.

slide-27
SLIDE 27

Selenium IDE

Interactive Development Environment for your

tests.

Record tests and then play them back. Easy to select fields from pages. Test step by step. Debug mode with breakpoints. Save tests as HTML files. (And other formats.)

slide-28
SLIDE 28

Selenium IDE

Interactive Development Environment for your

tests.

Record tests and then play them back. Easy to select fields from pages. Test step by step. Debug mode with breakpoints. Save tests as HTML files. (And other formats.) Accessed as a plug-in for Firefox.

slide-29
SLIDE 29

Selenium IDE

Firefox plug-in is available here:

http://docs.seleniumhq.org/download/#side_plugins

There are several versions; start here:

version 2.5.0 released on 01/Jan/2014

slide-30
SLIDE 30

The Selenium IDE plugin is here:

slide-31
SLIDE 31

The Selenium IDE plugin is here:

slide-32
SLIDE 32

Click the icon:

slide-33
SLIDE 33

File / New Test Case (Or Ctrl N):

slide-34
SLIDE 34

Enter a Base URL and File Save:

slide-35
SLIDE 35

Right Click / Insert a new cmd:

slide-36
SLIDE 36

selectWindow / Null:

slide-37
SLIDE 37

A * indicates the test needs to be saved:

slide-38
SLIDE 38

Click on the Source tab to see the HTML:

slide-39
SLIDE 39

Click on Table tab and press the Run button:

slide-40
SLIDE 40

And the test results will increment:

slide-41
SLIDE 41

Plus the Log will be populated:

slide-42
SLIDE 42

Easy, hæ?

slide-43
SLIDE 43

Now, let's make a suite of tests.

slide-44
SLIDE 44

File / New Test Suite:

slide-45
SLIDE 45

File / Save Test Suite:

slide-46
SLIDE 46

And, WaLa:

slide-47
SLIDE 47

Now, I want to test each tab:

slide-48
SLIDE 48

Turn on the Record function:

slide-49
SLIDE 49

Click every tab:

slide-50
SLIDE 50

Turn off the Record function:

slide-51
SLIDE 51

For each click, verify the title:

slide-52
SLIDE 52

...and save the test as a new name:

slide-53
SLIDE 53

Repeat this for all 11 tabs:

slide-54
SLIDE 54

Edit the Test Suite file:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="selenium.base" href="https://www.fcomputer.dk/" /> <title>FCTS1</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> <tr><td rowspan="1" colspan="3">FCTS1</td></tr> </thead><tbody> <tr><td><a href="TabTest01.html">TabTest01</a></td></tr> <tr><td><a href="TabTest02.html">TabTest02</a></td></tr> <tr><td><a href="TabTest03.html">TabTest03</a></td></tr> <tr><td><a href="TabTest04.html">TabTest04</a></td></tr> <tr><td><a href="TabTest05.html">TabTest05</a></td></tr> <tr><td><a href="TabTest06.html">TabTest06</a></td></tr> <tr><td><a href="TabTest07.html">TabTest07</a></td></tr> <tr><td><a href="TabTest08.html">TabTest08</a></td></tr> <tr><td><a href="TabTest09.html">TabTest09</a></td></tr> <tr><td><a href="TabTest10.html">TabTest10</a></td></tr> <tr><td><a href="TabTest11.html">TabTest11</a></td></tr> </tbody></table> </body> </html>

slide-55
SLIDE 55

Insert search word into Google:

slide-56
SLIDE 56

Google returns:

slide-57
SLIDE 57

Insert search word into Google:

slide-58
SLIDE 58

Google returns:

slide-59
SLIDE 59

Tips for Selenium:

  • Be organized! Establish a naming convention for

your test cases.

  • Be patient! Sometimes Selenium is a bit slow to

respond.

  • Use it! Don't mix Selenium tests with manual
  • tests. You will benefit in the long run.
slide-60
SLIDE 60

For further reference:

  • ISTQB
  • Agile Testing

http://www.amazon.com/Agile-Testing-Practical-Guide-Testers/dp/0321534468/ref=sr_1_7?s=books&ie=UTF8&qid=1406207011&sr=1- 7&keywords=software+testing