Selenium presentation

14
Selenium Selenium for web automation for web automation Madhu Kumari B.E Computer Engg.

description

Web Automation using Selenium: Pros and Cons with Comparison with similar tools available in market

Transcript of Selenium presentation

Page 1: Selenium presentation

SeleniumSeleniumfor web automationfor web automation

Madhu Kumari

B.E Computer Engg.

Page 2: Selenium presentation

Selenium Webdriver

● WebDriver is a tool for automating testing web applications

● It aims to provide a friendly API that’s easy to explore, understand and maintain

● It’s not tied to any particular test framework, so it can be used equally well in a unit testing or from a plain old “main” method

● Once your project is set up, you can see that WebDriver acts just as any normal library: it is entirely self-contained

Page 3: Selenium presentation

Selenium IDE

● It is the only flavor of selenium that allows us to record user actions on browser window

● Scripts recorded in IDE can be converted into other languages like Java, C#, Python and Ruby

● It is not only a time saver but also an excellent way of learning scripts syntax

● Allows to insert comments in the middle of the script for better understanding and debugging

● Supports context menu

Page 4: Selenium presentation

Selenium Webdriver: Portability

● All Java projects work the same with a src & bin folders and other related folders

● Each IDE creates it's own IDE project/workspace files as well

● One can use same source files within it's hierarchy of folders easily among different Java IDEs

● Just ensure to use standardized IDE for better portability experience

Page 5: Selenium presentation

Need of Eclipse for Automation using Selenium Webdriver

● Depends upon the requirements

● Eclipse has been one of the best IDEs for unit testing ever since it's early days

● But other alternatives to Eclipse for Automation using Selenium Webdriver are also available

Page 6: Selenium presentation

Is there any IDE available for web automation using Selenium?

● IntelliJ IDEA

– Have the best IntelliSense

– It's also an open source

– For the Ultimate license you have to pay

Page 7: Selenium presentation

Demerits of Selenium IDE

● It runs only in firefox browser

● Selenium IDE can execute scripts created in selenese only

● Cannot upload files

● It does not directly support loops and conditions

● Reading from external files like .txt, .xls is not possible

Page 8: Selenium presentation

Selenium IDE vs Selenium Webdriver

SR. NO. CRITERIA SELENIUM IDE SELENIUM WEBDRIVER

1 Browser compatibility

Only Mozilla Firefox Latest versions of all browsers – Firefox, IE, Opera, Chrome

2 Record and play/run tool

Available Not Available

3 Server Not required Core engine is Javascript based, interacts natively with browser application

4 Simple to use Yes Complex and a bit large API as compared to RC

5 Object oriented No Purely

6 Mouse cursor Cannot move mouse Can move mouse cursor

7 Listener No Listener Implementation is available

8 Test iPhone/Android application

Cannot test Can test

Page 9: Selenium presentation

Selenium vs

Low/Network level tools

● "Low/network" level tool like Htmlunit has the advantage of being fast - but its javascript will not work work in most complex websites(besides not being a browser test)

● Selenium(java, .net) code also has the disadvantage of being dependent on RC server(not big deal)

● You should continue low level tools like Httpunit for monitoring - but it's not preferable to use these tools for browser/regression testing.

Page 10: Selenium presentation

Selenium vs Watir

● For people favouring test cases in Ruby (or.net) then Watir is a tool

● Watir does have advantage that its recorder uses IE to record.

● With Selenium IDE – Only browser support is there for Firefox – else you will have to manually write the code

● The biggest advantage of Selenium is its support for FIT HTML and the vast languages/browsers/platform that it supports.(with good documentation)

Page 11: Selenium presentation

Selenium vs IMacros

● IMacros appears better in recording as compared to Selenium IDE

● As per automation Imacros is not powerful for automation as Selenium IDE

● For scheduling as well Selenium is better compared to IMacros

Page 12: Selenium presentation

Selenium vs Dejaclick● Dejaclick is probably the best (free) macro tool for websites

record and play.

● Selenium beats DejaClick in overall features(multiple language suport vs only XML support, free automation vs paid automation).

● Advantages of Dejaclick:

– It nicely plays back the recorded stuff - by highlighting appropriate items in green.

– It can easily record flash/silverlight - by recording position.(however it may mean that it may not nicely work in all computers)

– Allows to encrypt sensitive data

– Allows to bookmark the script for playback.

Page 13: Selenium presentation

Demerits of Dejaclick

● Disadvantage:

– Dejaclick recording tool is free - But for automation you have to rely on paid site alertsite

● AlertSite

– Provides great facility for running your dejaclick script and even soap xml from most of cities/region in US/world

– Also allows you to monitor the CDN performance/reliability or what content your website is serving across different regions

Page 14: Selenium presentation

Selenium vs Sahi● Pros:

– Multi-browser support

– Has its own IDE

– Record and playback tests

– Data-driven test via jdbc:odbc bridge

– Test success/failure reporting in html files

– Capabilities to run test using batch file or ant script

– Lightweight ● Cons:

– documentation needs to be enhanced

– need to be improved reporting