Pages

Wednesday, May 25, 2011

Selenium First steps

I am in the process of evaluating using selenium for automating a web interface.So first of all I don't know anything about it and I am trying o figure out how things work in selenium.
I first installed the selenium ide as a plugin to firefox from here.
I recorded a sample script and did a play back.Yes my first test worked like a charm .
Now I see there code and it is in html.I found out that there is way to generate code in Junit4 format (Options->Format->Junit 4).I changed the format to Junit 4.Now the play back option is gone.
So how do I play back Junit4 test cases of selenium??
Then I see there is a selenium server.Now the whole confusion starts and I know these are starting roadblocks.
There is selenium2 as well as selenium 1 and there is something called webdriver also.So I thought I will install the latest and I installed the selenium 2 server .I started it from console and I thought I will be able to run junit tests from there.But once I started server from console I realized ,there is no option to start scripts from there. Now I find something called as java driver and there is some firefox driver. I was confused as to what to use where.Later I found that java driver is used along with eclipse.So followed the steps to use the java driver in eclipse.OK, now I record the scripts in selenium ide in junit format and copy paste that code to eclipse and from here I can run the junit test cases.

So I am happy with the setup.But When I look at the test cases which has SeleneseTestCase is reported as deprecated by Eclipse.So What should I Do?Now I google again and I find that there is a webdriver format supported IDE plugin for firefox which  get from here. After installing the plugin I could generate code in Junit4 webdriver format and there is no warnings.

1 comment:

  1. Nice post. I also took a dive in the pool of selenium very recently. I could say that I have also faced almost all the roadblocks that you have mentioned above. Stackoverflow.com and google Code page of selenium helped me to learn from baby steps. Since selenium is a open source tool, its only by way of sharing the knowledge like this, that we can make it more popular and easier for beginners(like me). THanks Evelin.

    ReplyDelete