Thursday, April 21, 2011

Some input to Selenium users from my past excercise

Long time back when I started working on selenium, the market was rising for selenium and now I can say it is in boom. Companies are seeking good experience in selenium. As this is open sources tool, one can adopt this easily and what I found that the small companies and those working in web platform are needy of this tool.

Even from past more than 1.5 years I have not been using selenium but always keep my eyes on latest happening. Many of our blog readers asked me few common questions that what is the framework I used in selenium? and can we make our test data driven?


I decide to write this post to answer those questions and to share my past experience which may help you.


What is the framework I used in my project using selenium?

As I was working in java project, and I was not good in java programming also was new to selenium. But I was aware of the JUnit framework and some java basics so based on my findings and study, I recommended JUnit framework to be used in project for automation using selenium IDE and RC.



We used to recorded test in selenium IDE and export them in Eclipse and ran as JUnit. It has worked quite well. The Selenium tests are just treated like JUnit tests and run over the selenium server. You can further write some code to enhance your test and make them data driven. Its not a big deal for java developer to write code to connect with database and use data to your test. This way we successfully used selenium to automate few of our regression test cases.


to setup the environment you can refer my previous articles in Selenium.


One more question which people asked , can we connect database in selenium? so i would say yes, not in IDE but using RC you can. first thing, it’s not selenium who connect to database while it’s a framework or you can say you java code (taking example that you are working with junit framework) which allow you to connect with your database. This way you can connect with any database.


Please correct me if I am wrong. 


I have started working on QTP , so ready to read some good stuff in QTP also.

 

2 comments :

  1. Thanks Vishal. But how this framework is suitable and what are the limitations on using this JUnit framework with selenium.

    ---
    Sudheer

    ReplyDelete
  2. @Sudheer, It worked for me, i don't know if someone get stuck any where. Junit is a good unit testing framework and used everywhere. You can design your own if you are comfortable. I used this juts to avoid more work and My team was good in using JUnit.

    You can also try TestNG framework with selenium. I had tried to start working with TestNG and successfully setup the environment , but I did not get to work more. This is also good and even more useful as compare to JUnit as I read and take input from others.

    ReplyDelete