Selenium An Effective Weapon In The Open Source Armory

Komal Joshi Director: Atlantis Software Limited Anand Ramdeo Head of Quality Assurance: GCAP Media

Atlantis Software | www.atlantissw.com

www.TestingGeek.com

Agenda
• • • • • • Introduction to Selenium Selenium IDE – Lets play Limitations of Selenium IDE Selenium RC – Play Again Ruby with Selenium RC Discussion / Questions

Atlantis Software | www.atlantissw.com

www.TestingGeek.com

What is Selenium?

Atlantis Software | www.atlantissw.com

www.TestingGeek.com

• Free & Open Source !!! Atlantis Software | www. • Support many languages.com .TestingGeek. including Ruby. Java and so on.com www. Python. • Developed in Java Script.atlantissw.Selenium is… • Test automation tool for web applications. • Can be used for most of the browser / platform combinations.

Effect of Open Source on Selenium • • • • Selenium IDE Selenium Core Selenium Remote Control Selenium Grid User / developer community solving problems for most of us and making us more productive.TestingGeek.atlantissw.com . Atlantis Software | www.com www.

com www.TestingGeek.com .atlantissw.Why Learn Selenium? To make this world a better place!!! How?? Well tested web applications will result in less frustration for the end-users and will make them happy!!! Atlantis Software | www.

atlantissw. • Desktop applications are slowly becoming history. • Web is becoming important.com www.TestingGeek.Learn Selenium Because.. • Most of the Rich Web and AJAXified Applications involve Java Script. Atlantis Software | www. • Selenium is the best tool for testing Java Script and Java Script interactions.com .

com www.TestingGeek.Let’s Play Atlantis Software | www.com .atlantissw.

Selenium IDE • Firefox plug-in • Integrated Development Environment for Selenium Tests.atlantissw. • Provides the ability to debug test scripts.TestingGeek.com www. Ruby. • Export tests in different formats like HTML. • Provides record and playback functionality. Python and so on.com . Atlantis Software | www. • Supports user extensions. • Auto complete common selenium commands.

atlantissw. Atlantis Software | www.openqa.Install & Start • Download from http://www.com www.com .TestingGeek. org • Access Tools – Selenium IDE from Firefox browser toolbar.

TestingGeek.com www.atlantissw.com .IDE Explained Atlantis Software | www.

Type “Testing Geek” in the Google search bar and click Search On the search results verify that – “Software Testing .com www.Geek” is present at the first place.co. View the results back in the IDE Atlantis Software | www.TestingGeek.com .uk in Firefox Open Selenium IDE. Save the test case as google_ide Run the saved test case back again using the IDE.com is the first link for Google search on “Testing Geek” • • • • • • • • Open http://www.google.TestingGeek. Tools – Selenium IDE Ensure that Selenium IDE is in recording mode.Exercise Ensure that http://www.atlantissw.

.com www.Selenium IDE contd. Atlantis Software | www.atlantissw.com .TestingGeek.

com www.TestingGeek.com .atlantissw.Test Runner Atlantis Software | www.

Atlantis Software | www. It can not be used for different browsers.Limitations • Browser – Selenium IDE is only available for the Firefox. • Language – Selenium IDE can execute scripts created in Selenese only.atlantissw.TestingGeek. • Complexity – It is difficult to use Selenium IDE for checking complex test cases involving dynamic contents.com .com www.

com .What Next?? Atlantis Software | www.TestingGeek.atlantissw.com www.

• Bundles Selenium Core and automatically loads into the browser Atlantis Software | www. • Acts as a proxy for web requests from them. • Client libraries for many popular languages. written in Java and so available on all the platforms.Selenium Remote Control • A server.com www.TestingGeek.atlantissw.com .

atlantissw.How it works Atlantis Software | www.com .TestingGeek.com www.

org • Unzip to any directory on your file system. • Change directory to the Selenium Server on the command line or terminal.openqa. • Downloaded Selenium RC from http://www. • Start Selenium Server.atlantissw.Install & Start • Ensure that JDK is present on the machine and is in the class path.TestingGeek.com www.com . Atlantis Software | www.

com www.atlantissw.TestingGeek.Change Directory to Selenium Server Start selenium Server Atlantis Software | www.com .

• Give access to the rich features and libraries of the language.com www.TestingGeek.com . we will use Ruby. Atlantis Software | www. • Which one you should use? – Whatever make sense in your context. • Available in Ruby. C-Sharp … and so on. For this exercise.atlantissw. Java. Python. including their unit testing framework. • Makes it possible to develop automated scripts in the same language as product.Selenium client drivers • Enables communication with Selenium Remote Control Server. • Functionality of Selenium is exposed via these drivers.

ruby-lang.TestingGeek. Atlantis Software | www. and • Perl's pragmatism. • Python's ease of use and learning. Ruby is the successful combination of: • Smalltalk's conceptual elegance.atlantissw.com www.What is Ruby??? • It is object oriented scripting language • Download from http://www.org • According to official Ruby Website.com .

com . • Your automation script can live anywhere in the file system as long as path is set properly. Atlantis Software | www.atlantissw. • Open a separate command prompt and change its directory to the Ruby Driver.com www.Ruby Client Driver • Ruby driver is bundled with the product itself. • Check content of the directory where Selenium was unzipped initially.TestingGeek.

• Analyze the test script.atlantissw. • Export this test case as ruby.Lets Start • Record a sample script in Selenium IDE. Atlantis Software | www.TestingGeek.com . same as first exercise.com www.

Client Driver and ruby unit testing framework Setup is executed before every test case.TestingGeek.com . Browser Tear down is executed after every test case and kills selenium and browser. gives selenium object and launches browser.com www.atlantissw. Test case. Steps Atlantis Software | www.

com www.com .TestingGeek.atlantissw.Run it !!! Loading/ Runnning a ruby test case with ruby command Atlantis Software | www.

• Makes it possible to create fast.atlantissw. robust and scalable automation. Atlantis Software | www. • Can be used to automate complex test cases.com . • Have access to the complete features / libraries of the high level language.TestingGeek.com www.Selenium RC Benefits • Can be used for any Java Script enabled browser.

TestingGeek.atlantissw.alephzarro.com . Atlantis Software | www. screenshot and so on.com/download – Based on DOM • Element Filters – Based on Index – Based on Value • Regular expression • WaitForXXX .com www.Interesting Stuff • Element Locators – Based on XPath. use XPather from http://xpath. eval.

com www. troubleshooting and information on support. Contact us ☺ – info@atlantissw.TestingGeek. • Selenium articles on http://www.org for official documentation.com • Visit www.openqa.What if I have Questions? • Well.com Thank You!!! Atlantis Software | www.TestingGeek.com .com – testinggeek@gmail.atlantissw.

QUESTIONS?? Atlantis Software | www.TestingGeek.com www.com .atlantissw.

Sign up to vote on this title
UsefulNot useful