Download - Selenium By Pravin Mishra
![Page 1: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/1.jpg)
Selenium – Testing Tool By:Pravin Mishra [email protected]
![Page 2: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/2.jpg)
Contents
• Why testing?
• Selenium Overview
• Benefits of selenium
• Component of selenium.
• Selenium IDE Introduction
• Installing Selenium IDE
• Running a Simple Test
• Installing Useful Tools for Writing Tests
• Creating Selenium Test Suites
• Questions?
![Page 3: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/3.jpg)
Why testing?
• Confidence=>Verification that our system behaves as it is suppose to.
• Manually
• Automated
->Automated testing is less painful and much easier.
![Page 4: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/4.jpg)
What is selenium?
• Selenium is an open source automation testing tool for automating web based applications. It can only automate web based applications. It works on multiple browsers and multiple operating systems. Being open source and very strong in nature, demand for this tool is increasing.
![Page 5: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/5.jpg)
Programming Languages
• Ruby.
• Java.
• C#.
• PHP
• Python
• Perl
![Page 6: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/6.jpg)
Browsers
• Mozilla
• IE 6,7,8
• Google Chrome
• Opera 8,9,10
• Safari
![Page 7: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/7.jpg)
Operating Systems
• Windows
• Mac
• Linux/Unix
![Page 8: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/8.jpg)
Benefits of Selenium - Open source
- Works on multiple browsers Mozilla, Chrome, IE, Opera, Safari
- Works on multiple Operating Systems
- Supports many languages
- Tests Ajax Applications
- Tests Flash Applicatons
- Can do Database Testing
- Multiple test frameworks are supported
- Can be used for Functional and UI testing
![Page 9: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/9.jpg)
What is selenium IDE?
1. Record and run functionality.
2. It gets installed as an add-on on Mozilla and works only on Mozilla.
3. That's why RC or webdriver comes in picture.
4. We can write our own extensions and implement loops, if statements, use arrays, parameterize test cases.
5. All this is done with the help of user extensions. One needs to know JavaScript in order to do this because the core engine of IDE is JavaScript based.
![Page 10: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/10.jpg)
What is selenium RC(remote control)?
• Execute in multiple browsers, on remote machines• Automate Selenium tests from Java/.NET/Ruby etc• Integrate into wider business tests and CI tools
![Page 11: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/11.jpg)
What is selenium 2 OR web driver?• Selenium 2 or Webdriver is the new version of Selenium.
What is Selenium GRID• Run tests on multiple machines in parallel• Solves the biggest problem with Selenium, speed
![Page 12: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/12.jpg)
Installing Selenium IDE
• Installing Selenium is a two step process
– First: If Firefox is not installed in your machine then Install Firefox
– Second: If Selenium IDE is not installed on your machine then Install Selenium IDE Plug-in
![Page 13: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/13.jpg)
IE Version of Selenium
• Is there an IE version of Selenium IDE?
– No, at this point of time Selenium IDE works only for Firefox. You can write your test scripts via IDE and then use the Selenium Core TestRunner or Selenium RC to execute them on IE.
![Page 14: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/14.jpg)
Check Firefox Version• Click on the Mozilla Firefox• Go to Help About as shown below:• Check the version name• What is your version?
In this About Window, it shows Firefox version 2.0.0.16
![Page 15: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/15.jpg)
Installing Selenium IDE
• Open the Firefox browser window (*1)• Go to Tools Check whether Selenium IDE already exist
there (*2)• If you see “Selenium IDE”, Hurray, You are already having
Selenium IDE plug-in is installed in your Firefox browser• If not installed then follow the instruction on the next slide
Check whether Selenium IDE is already installed
*1
*2
![Page 16: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/16.jpg)
Installing Selenium IDE
• Open the Firefox browser window (*1)• In the navigation tool bar type the below URL:
– http://seleniumhq.org/download/– Under Downloads Choose Selenium IDE(*1)
Don’t do this in IE browser
Click download
![Page 17: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/17.jpg)
Installing Selenium IDE
• Click Allow if Firefox prevents to install
Click Allow
![Page 18: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/18.jpg)
Installing Selenium IDE
• When the Software Installation Window appears, select “Selenium IDE” (*5)
• Press Install button• “Selenium IDE” Add on is installed (*6)• Click on “Restart Firefox” button(*6)
*5
Restart to take effect of the
Selenium Plug-in
*6
![Page 19: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/19.jpg)
Installing Selenium IDE
• Now, in the Firefox browser go to Tools and verify whether “Selenium IDE” is displayed (*8).
• If found, then the Selenium IDE installation is completed. (Congrats !)
*8
Selenium IDE is successfully
installed
![Page 20: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/20.jpg)
Selenium IDE
Click Selenium IDE in the menu which will bring the Selenium IDE to you (*9)
The list ofactions in theactual test caseto execute
The root of web application youwant to test
The log of theevents that wereexecuted, includingany errors orwarning that mayhave occurred
![Page 21: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/21.jpg)
Selenium IDE
ExecutionCommands
Record testactions
Try the test inthe Web basedTestRunner
Specify commands,including asserts
Reference of thecurrently selectedcommand
![Page 22: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/22.jpg)
Test Creation Demo in https://login.secureserver.net
![Page 23: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/23.jpg)
Login to https://login.secureserver.net Click on Tools || Selenium IDE
![Page 24: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/24.jpg)
Selenium IDE in recording Mode
![Page 25: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/25.jpg)
Add Login Details
![Page 26: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/26.jpg)
Click On Submit
![Page 27: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/27.jpg)
Login Successfully
![Page 28: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/28.jpg)
Selenium IDE records the Test Steps
Stop Recording
![Page 29: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/29.jpg)
Save Test Case/Test Suite
![Page 30: Selenium By Pravin Mishra](https://reader033.vdocument.in/reader033/viewer/2022061118/5468c2fcaf7959a75e8b5672/html5/thumbnails/30.jpg)
Run the entire Test Suite/Each Test CaseSee RESULT Here