Selenium VS WatiJ

经过深入思考,觉得方向还是在测试,WEB自动化测试。开源的WEB测试工具和脚本语言是这个方向的两大武器。先比较一下两款工具。

原文:http://www.softwaretestingclub.com/profiles/blogs/selenium-vs-watij

Selenium VS WatiJ

My ultimate goal in the last week was to automate smoke tests. 70-80% of the tests involve message sending and reading from message queue (JMS) and the necessary message content string manipulations (parse, find, replace,etc.) only 20-30 % involve UI (i.e. testing cases when wrong message must be fixed manually). JAVA is a natural selection for managing JMS (JAVA message service). To make data transfer from messages to UI and back simpler I want a tool to interact with web UI using JAVA code. There were two natural choices: WatiJ and selenium. 

Choosing the tool
I know some books could tell you how to boild the right process to select a tool. I don't believe them. Let me share my story. Feel free to drop a comment if you think any my step was stupid - I'm not a guru in automation really...
1. Try WatiJ. Colleague of mine have been using WatiJ for quite a while so I chose to use it as I have a person to ask for help. I wasn't able to figure out how to even login.
2. I move to selenium where record-playback help me to prepare JUnit test for logging in without analysing DOM
3. I realize I have no idea how to call selenium methods from my existing code.Selenium generates unit tests not a plain JAVA code.
4. Selenium code shows me that I must select a frame and I can proceed
5. I have no idea how to make my watij click on a tab which is implemented as table cell (neither table tor cell have unique IDs)
6. I move back to selenium as it has no problems with the tab, it use on click unique reference to discover it.
7. I run into problem with selenium, but an hour of investigation shows me that selenium adds extra selenium.selectWindow() during capture, although it is enough to have selenium.selectFrame(). The most interesting fact is that test works from selenium IDE (with select Window), but don't work when exported as JUnit

Conclusions   on automation
I has solved the problem and have automated 30% of some tests that take about 2 hours of manual execution . I've done it in a week, spending less than 50% of my time and learned both selenium and watiJ. I know automation guru would say it takes up to 5 times as much time to automate compared to execute, but it took more for me. Perhaps I'm just learning yet, 

Conclusions on tool selection
The problem mentioned in step #7 I only encountered when writing code for logging out current user and logging in a new one. That's something any pilot project would miss, I believe. 
More over I'm still open to switch back to WatiJ. Refeactoring tests from watj to selenim took me a few hours at most. Or maybe I will use both tools? I don't know. 
Why should I  choose  tools, when they come for free? I don't have to choose a single hammer or screwdriver, I have a couple of them, don't you? I only choose when I see a screw or nail. 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值