Thursday, May 30, 2013

Locating Elements in Selenium

Attributes for elements:

  name
  id
  href
  title
  value
  class




Locating Elements in Selenium

Examples of Elements on Html page:

  Input
  button
  form
  span
  ol
  ul
  a

Locating Elements in Selenium

Some Objects on web page:

  checkbox
  radio button
  link
  dropdown
  text field
  text area
  button

Identify the elements using IE Developer tools

Install  Developer tool

The Internet Explorer Developer Toolbar provides several features for exploring and
understanding Web pages. These features enable you to:
Locate and select specific elements on a Web page through a variety of techniques
View HTML object class names, ID's, and details such as link paths.

How to Install:



Go to below link
http://www.microsoft.com/download/en/details.aspx?id=18359

How to identify elements in Selenium: Firebug

 Firebug:

Firebug is an Add-on for FireFox.
To Install Firebug Open  http://getfirebug.com/ in FireFox.



Click on Install Firebug



and complete the full process of installation.

after that..


Get a message “Restart Firefox to complete your changes.” Click on “Restart
Firefox”
After Restarting the browser, open www.google.com,
Right click on any element, we will get Inspect Element option.

Tuesday, May 28, 2013

How to identify the elements in Selenium

LOCATORS
Tools to identify elements/objects

There are some tools to identify the elements

  Firebug
  IE DebugBar
  Google Chrome Developer Tools


Firebug: Firebug mostly used by web developers, as it allows developers to find
elements on the page by using the find functionality.

IE DebugBar: This is an add-on for IE. It also has many features like Firebug.

Google Chrome Developer Tools: This is not like IE or Firefox Google chrome
developer tools is built-in to the browser and will also allow you to find the
elements on the page and be able to work out its XPath.

Recording your first test with Selenium-IDE



Steps:
1.  Open URL www.google.com
2.  Type “expertinqtp.blogspot.com” in search box
3.  Click on search button
4.  Click on first link in search results

Thursday, May 23, 2013

Selenium IDE Icon

Selenium IDE Icon.












Base URL—This is the URL that the test will start. All open commands
will be relative to the Base URL unless a full path is inserted in the open
command.
  Speed Slider—This is the slider under the Fast Slow labels
on the screen.
  —Run all the tests in the IDE.
  —Run a single test in the IDE.
  —Pause a test that is currently running.
  —Step through the test once it has paused. 



The Selenese Command select box has a list of all the commands that are
needed to create a test. You can type into it to use the auto complete
functionality or use it as a dropdown.
  Target textbox allows you to input the location of the element that you want
to work against.
  The Find button, once the target box is populated, can be clicked on to
highlight the element on the page.
  Value textbox is where you place the value that needs to change. For
example, if you want your test to type in an input box on the web page, you
would put what you want it to type in the value box.
  The Test table will keep track of all of your commands, targets, and values.
It has been structured this way because the original version of Selenium was
styled on FIT tests. The tests were originally designed to be run from HTML
files and the IDE keeps this idea for its tests. If you click on the Source tab,
you will be able to see the HTML that will store the test. Each of the rows will
look like:
o  <tr>
o  <td>open</td>
o  <td>/chapter1</td>
o  <td></td>
o  </tr>
  The area below the Value textbox will show the Selenium log while the tests
are running. If an item fails, then it will have an [error] entry. This area will
also show help on Selenium commands when you are working in the
Command select box. This can be extremely useful when typing commands
into the Selenium IDE instead of using the record feature

Wednesday, May 22, 2013

How to install Selenium IDE?

Pre Requisites:
  Mozilla Firefox

Installation:

  Go to http://seleniumhq.org/download/.
  Click on the download link for Selenium IDE. You may get a message saying Firefox prevented
this site (seleniumhq.org) from asking you to install software on your computer.
  Please click on the Allow button.
  A pop up will appear.
  Install button will become active and then click on it.
  This will now install the Selenium IDE as a Firefox add-on.
  Once the installation process is complete, it will ask you to restart Firefox.
  Click on the Restart button. Firefox will close and then reopen.
  Once the installation is complete, the Add-ons window will show the Selenium IDE and its
current version.
Start Selenium IDE:
1.  Open a new Firefox browser
2.  Click on tools
3.  Click on Selenium IDE

Selenium-IDE

  Selenium-IDE is the Integrated Development Environment for building Selenium test cases.

  It is Firefox add-on and provides an easy-to-use interface for developing and running individual
test cases or entire test suites.

  Selenium-IDE has a recording feature, which will keep account of user actions as they are
performed and store them as a reusable script to play back.

  It also has a context menu (right-click) integrated with the Firefox browser, which allows the
user to pick from a list of assertions and verifications for the selected location.

  Selenium-IDE also offers full editing of test cases for more precision and control.

  Although Selenium-IDE is a Firefox add-on, tests created in it can also be run against other
browsers by using Selenium-RC and specifying the name of the test suite on the command line

What is the difference between Selenium and QTP

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/



Selenium                                                                                          QTP

Open source                                                                           Commercial

Works on all OS                                                             Works on Windows only

Tests only Web applications                                             Tests web and desktop
                                                                                        applications

Code can be converted to any one of languages such as                   Uses VB script
Java, C#, Ruby, Python, pearl, php etc
                                                                                                  
No object repository                                                      Has got an object repository

IDE sometimes does not record some fields                     Recording is a little reliable
                                                                                       events

what are the advantages of Selenium

 Selenium is an Open source, Free software
 Easy Installation
  Easy Record and Play back
  Supports Multiple operating systems
  Supports Multiple Browser Testing
  Can convert scripts in to other languages (Java, C#, Python, Pearl etc...)
  Esay to learn
  Script once, Run on multiple browsers
  Testing tool for browser-based testing of web applications. It can be used both for functional,
compatibility (it has extensive cross-browser support) and regression testing.
Selenium is the best open source tool for doing automation for web based application and it does not
have any cost attached to it. The only cost is the effort which will go for designingand developing the
script for the application.There are Huge Openings in selenium because companies are trying to
migrate from QTP or commercial tools to Selenium – Open source tool.
There are a set of Selenium tools which when combined provides you the power to automate simple to
complex web application

How selenium work?

 Uses JavaScript and Iframes in the browser
 Core runs the tests and interrogates the DOM
  RC server and Core communicate via AJAX
  Language hooks communicate with the RC server.

Selenium Introduction

Hi everybody,
Now i am working with selenium tool so please enjoy the new tool which is open source.

Selenium:
Selenium is a robust set of tools that supports rapid development of test automation for web-based
applications. Selenium provides a rich set of testing functions specifically geared to the needs of testing
of a web application. These operations are highly flexible, allowing many options for locating UI
elements and comparing expected test results against actual application behaviour.
Selenium: Selenium is a suite of tools to automate web app testing across many platforms.
Selenium...runs in many browsers and operating systems. Can be controlled by many programming
languages and testing frameworks.

* Create by developers at ThoughtWorks
* Released publically as an Open Source project on OpenQA
* Selenium is a test tool for web applications.
* Selenium tests run directly in a browser.
* Runs on Windows, Linux, and Macintosh.
* Runs in Internet Explorer, Mozilla and Firefox.
* Enables Browser Compatibility Testing.
* Enables System Functional Testing.