June 29, 2011

How to run Selenium RC with Eclipse




I am a new user to use selenium with eclipse.
Had lots of doubt and lots of stuff to run a single program at last I found the way to run the application.

1- Download Selenium-RC from the Selenium HQ download file option and save this some directory (E:/seleniumrc) where you want.
2- Launch eclipse
3- Create a new java project which you can get by configuring selenium with Eclipse.

I follow the following scenario to configure Rc and with eclipse with the help of link http://seleniumhq.org/docs/appendix_installing_java_driver_client.html#configuring-selenium-rc-eclipse-reference
Steps:
a)   Select File>> New>>Java Project
b)   Enter the “Project Name”.
c)   Select “jdk 1.5.0._05” under JRE. Issue I faced in this step is “jdk” is not configured properly hence it’s not displayed. So I select “Configure path link.
Select “Search” option under installed JREs. And I select the location where the JDK is installed in my system.
I select “JDK” checkbox and select “OK” option and then its make easier for me to configure “JDK” and select “Next” button in “New Java Project” window.
d)   Select “Libraries” tab and select “External Jar” button.
e)   Browse and upload the jar files which are available in “selenium server” downloaded file. [Add external jar files. (from the location where you have already saved downloaded selenium rc)]
f)    Select “Finish” option.

4- Right click on “src” folder and select “new folder” option and enter folder name as core. Core is displayed like a package.
Similarly select “new folder” and add “core” and “testscripts”. Both were folder names.
5- Right click on “src” and add a new “class”
6- Add your saved java file in the new “class” and save the file.(which you have saved after recording in IDE) to this project.
7- Now run this code as Junit test

This is the java code which i have recorded using IDE to test the Login in Word press demo tool.

import com.thoughtworks.selenium.SeleneseTestCase;

public class se extends SeleneseTestCase {
      public void setUp() throws Exception {
            setUp("http://demo.opensourcecms.com/", "*chrome");
      }
      public void testJunit() throws Exception {
            selenium.open("/wordpress/wp-login.php");
            selenium.type("user_login", "admin");
            selenium.type("user_pass", "demo123");
            selenium.click("wp-submit");
            selenium.waitForPageToLoad("30000");
            verifyTrue(selenium.isTextPresent("Howdy, admin"));
            selenium.click("link=Posts");
            selenium.waitForPageToLoad("30000");

                  }
}
Running the same in various browsers:
You can now run this test in different browse by initializing the desired browser info like firefox, iexplorer, chrome..
setUp("http://www.google.co.in/", "*firefox") ;

I hope this will help you to get started with you very first test using selenium RC.





http://knorrium.info/2010/05/19/a-java-approach-to-selenium/ this blog is really more helpful for me to run selenium RC thanks too... 

June 27, 2011

Start up for Selenium Grid


Selenium Grid:
My first step for running grid
i)                     installed the java JDK process:1.6.0_24 version
ii)                   After JDK installation select command prompt and enter the command of  java –version
This will be displayed as

iii)                 And I struck in installation process of ANT  
ANT Installation:
a)First I download the ANT version 1.8.2
b)And copied it in path: C:/Program files
c) Select Command prompt and enter ant –version
I got an issue in tools.jar while running it [Unable to locate tools.jar. Expected to find it in C:\Programfiles\java\bin\tools.jar
Apache Ant(TM) version 1.8.2 compiled on December 20 2010]
Reason: This error is caused because system properties path is not defined properly.
c) Then I tried many times got the same issue in command prompt.
d) After a long time I got the Executable file for ANT installation
I get the executable file for ANT installation with the help of this link http://code.google.com/p/winant/
e) Next I select “Control Panel” and “System” icon, and select “Advanced” tab.

Select “Environment Variables” which displays like the below window.


Here I had another issue while setting path:

Please confirm or add these stuffs under “Environment Variables”

Under System Variables:
Variable name: ANT_HOME
Variable Value: C:\apache-ant-1.8.2(Exact path of the ant builder)
Under User Variables: This is for Java JDK process
Variable Name: JAVA_HOME
Variable value: C:\Program Files\Java\jdk1.6.0_24
For ANT installation:
Variable Name: ANT_HOME
Variable value: C:\Program Files\WinAnt


Next select new command prompt:
a)Got the selenium grid path
b)enter “ant sanity-check”

Build successful is displayed.
Now the selenium grid is installed successfully.

These are link which helps for me to run:

After successful run of ant builder, going to start testing a sample application which I got from a website

June 9, 2011

Traceability Matrix


Traceability Matrix – A document
showing the relationship between Test Requirements and Test Cases. From
Traceability Matrix, we can check that which requirements are covered in which
test cases and "particular test case covers which requirements".

In this matrix, we can also cover that a particular requirement is covered in
 which section of code etc.

In this matrix, the rows will have the requirements. For every document {HLD,
LLD etc}, there will be a separate column. So, in every cell, we need to state,
what section in HLD addresses a particular requirement. Ideally, if every
requirement is addressed in every single document, all the individual cells must
have valid section ids or names filled in. Then we know that every requirement
is addressed. In case of any missing of requirement, we need to go back to the
document and correct it, so that it addressed the requirement.

In a nutshell, requirements traceability is the process of ensuring that one or
more test cases address each requirement.
 


Example of a Traceability Matrix document:
 Req ID Req Description TC001 TC002 TC003
 R1.1 ………YesYes
 R1.2 ……….Yes
 R2.1 …….Yes
Example of a Traceability Matrix document:
 Req ID Req Description TC001 TC002 TC003
 R1.1 ………YesYes
 R1.2 ……….Yes
 R2.1 …….Yes

Above table shows –
Requirement R1.1 is covered in TC001 and TC003.
R1.2 is covered in TC001.
R2.1 is covered in TC002

Above table also provides the test coverage. Fron Traceability Matrix document,
we can ensure that all the requirements are addressed in the test cases. More
science behind traceability matrix can be found at Software Testing Times (See
below links).
 
SourceDescriptionTutorial Link
WikiPedia 
Here wikipedia gives a
complete theoretical information about traceability Matrix. – A Must
Read for beginners 
Software Testing Times 
Traceability Matrix from
Software Testing perspective. This is a very helpful topic for test
leads and managers (also for junior testers if they want to grow). It is
a step by step guide to prepare Traceability Matrix with attached sample
template. 
Crosstalk – A Journal of
Defence Software Engineering 
Andrew Kannenberg, Garmin
International Dr. Hossein Saiedian, The University of Kansas 

Questions with Selenium IDE


Q1. What is Selenium?
Ans. Selenium is a set of tools that supports rapid development of test automation scripts for web
based applications. Selenium testing tools provides a rich set of testing functions specifically
designed to fulfil needs of testing of a web based application.

Q2. What are the main components of Selenium testing tools?
Ans. Selenium IDE, Selenium RC and Selenium Grid

Q3. What is Selenium IDE?
Ans.
 Selenium IDE is for building Selenium test cases. It operates as a Mozilla 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.

Q4. What is the use of context menu in Selenium IDE?
Ans. It allows the user to pick from a list of assertions and verifications for the selected location.

Q5. Can tests recorded using Selenium IDE be run in other browsers?
Ans.
 Yes. Although Selenium IDE is a Firefox add on, however, tests created in it can also be run in
other browsers by using Selenium RC (Selenium Remote Control) and specifying the name of the test
suite in command line.

Q6. What are the advantage and features of Selenium IDE?
Ans. 1. Intelligent field selection will use IDs, names, or XPath as needed
2. It is a record & playback tool and the script format can be written in various languages including
C#, Java, PERL, Python, PHP, HTML
3. Auto complete for all common Selenium commands
4. Debug and set breakpoints
5. Option to automatically assert the title of every page
6. Support for Selenium user-extensions.js file

Q7. What are the disadvantage of Selenium IDE tool?
Ans.
 1. Selenium IDE tool can only be used in Mozilla Firefox browser.
2. It is not playing multiple windows when we record it.

Q8. What is Selenium RC (Remote Control)?
Ans.
 Selenium RC allows the test automation expert to use a programming language for maximum
flexibility and extensibility in developing test logic. For example, if the application under test returns
a result set and the automated test program needs to run tests on each element in the result set, the
iteration / loop support of programming language’s can be used to iterate through the result set,
calling Selenium commands to run tests on each item.

Selenium RC provides an API and library for each of its supported languages. This ability to use
Selenium RC with a high level programming language to develop test cases also allows the automated
testing to be integrated with the project’s automated build environment.

Q9. What is Selenium Grid?
Ans. Selenium Grid in the selenium testing suit allows the Selenium RC solution to scale for test suites
that must be run in multiple environments. Selenium Grid can be used to run multiple instances of
Selenium RC on various operating system and browser configurations.

Q10. How Selenium Grid works?
Ans. Selenium Grid sent the tests to the hub. Then tests are redirected to an available Selenium RC,
which launch the browser and run the test. Thus, it allows for running tests in parallel with the entire
test suite.

Q 11. What you say about the flexibility of Selenium test suite?
Ans.
 Selenium testing suite is highly flexible. There are multiple ways to add functionality to Selenium
framework to customize test automation. As compared to other test automation tools, it is
Selenium’s strongest characteristic. Selenium Remote Control support for multiple programming and
scripting languages allows the test automation engineer to build any logic they need into their
automated testing and to use a preferred programming or scripting language of one’s choice.
Also, the Selenium testing suite is an open source project where code can be modified and
enhancements can be submitted for contribution.

Q12. What test can Selenium do?
Ans.
 Selenium is basically used for the functional testing of web based applications. It can be used for
testing in the continuous integration environment. It is also useful for agile testing

Q13. What is the cost of Selenium test suite?
Ans.
 Selenium test suite a set of open source software tool, it is free of cost.

Q14. What browsers are supported by Selenium Remote Control?
Ans. 
The test automation expert can use Firefox, IE 7/8, Safari and Opera browsers to run tests in
Selenium Remote Control.

Q15. What programming languages can you use in Selenium RC?
Ans.
 C#, Java, Perl, PHP, Python, Ruby

Q16. What are the advantages and disadvantages of using Selenium as testing tool?
Ans.
 Advantages: Free, Simple and powerful DOM (document object model) level testing, can be used
for continuous integration; great fit with Agile projects.

Disadvantages: Tricky setup; dreary errors diagnosis; can not test client server applications.

Q17. What is difference between QTP and Selenium?
Ans.
 Only web applications can be testing using Selenium testing suite. However, QTP can be used for
testing client server applications. Selenium supports following web browsers: Internet Explorer,
Firefox, Safari, Opera or Konqueror on Windows, Mac OS X and Linux. However, QTP is limited to
Internet Explorer on Windows.

QTP uses scripting language implemented on top of VB Script. However, Selenium test suite has the
flexibility to use many languages like Java, .Net, Perl, PHP, Python, and Ruby.

Q18. What is difference between Borland Silk test and Selenium?
Ans.
 Selenium is completely free test automation tool, while Silk Test is not. Only web applications
can be testing using Selenium testing suite. However, Silk Test can be used for testing client server
applications. Selenium supports following web browsers: Internet Explorer, Firefox, Safari, Opera or
Konqueror on Windows, Mac OS X and Linux. However, Silk Test is limited to Internet Explorer and
Firefox.

Silk Test uses 4Test scripting language. However, Selenium test suite has the flexibility to use many
languages like Java, .Net, Perl, PHP, Python, and Ruby.

What Is the Cloud?



Ten years ago, you could go to www.google.com and get results. You didn't exactly know where the Google web server was. Google was running a number of server farms, and you didn't care which server provided your request. For that matter, you might search on something else five seconds later and hit a different machine. 

In that sense, the cloud has been a reality for years. If we count Telnet and email, it's been a reality for decades. 

Yet, in another sense, the cloud era is very new. Now, we get to build the cloud-based services for ourselves. Like Google spread its work over 10,000 computers, we testers may, in some ways, spread our work out. 

This brings two very different ideas to the masses. The first is virtualization, which allows us to combine the services of many computers onto one physical machine. The second is distributed computing, harnessing a large number of computers as one. 

Tester Smooth Moving With Developer


1. Share your strategy with developers. Don’t keep it in mind thinking that you will mark it as an issue at later stage.

2. Try to build friendly relations with developers, so that they can feel comfortable to share anything with you.

3. Keep your issue reporting style positive, it should not hurt someone’s feelings.

June 2, 2011

Web Page Validations

Web Link Validator:
Web Link Validator is a powerful link checker and site management tool. People who are working with the websites to check links for accuracy, availability and also to find the broken links. Links containing errors will also be identified. Using the Weblink Validator we can easily handle websites containing thousands links (including the links coded with any technology (JavaScript and Flash, or embedded in the image maps, scripts, applets and forms)) and also it offers a number of features that help webmasters dramatically improve the site processing speed and use system resources in a more efficient manner. Processing things will gets improved a lot.
Web Link Validator is an essential solution for site administrators, web developers and anyone else working to provide more quality for their web sites. Keep track of the broken link and quality of the HTML page will be identified.

REL Link Checker Lite:
REL Link Checker Lite is also another tool to check the dead links and error in the links. it is free easy-to-use. It verifies the list of the given links and provide the better solution for you about the web page. This will check up to 1,000 links during single session and It will help you easily locate broken links. This is the free version of a more powerful commercial version:

Kindly view the below links....

http://www.relsoftware.com/

Create your HTML page and check with the W3C standards. So that you can improve the performance of your web page.... Code compatible, Scalable and hell lots of thing will happen
Donot miss to test your web page with the below web W3C site
http://validator.w3.org