tag:blogger.com,1999:blog-4065813838796681997.post1393752345568319766..comments2023-03-28T12:31:44.912-04:00Comments on QA & Testing: Watij versus Selenium-RC [Java]Darrellhttp://www.blogger.com/profile/18232752184374702137noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-4065813838796681997.post-20009242795828638742010-10-10T13:45:27.536-04:002010-10-10T13:45:27.536-04:00One trick I do is using the old school method of &...One trick I do is using the old school method of 'print'. Just before you are attempting to locate something, get the HTML source of the page using the test automation tool.<br /><br />Using Java and Selenium RC, if I was trying to find a button to click, just above the button click I would save the contents of selenium.getHtmlSource() into a variable. I'd then set a breakpoint on the line to click the button. When it reaches the breakpoint, I can examine the variable holding the results of selenium.getHtmlSource(). Run it once with Firefox then again with Internet Explorer. The getHtmlSource() method will show me what Selenium is seeing at that moment. This can often be different from what the browser will show you with 'View Source'.Darrellhttps://www.blogger.com/profile/18232752184374702137noreply@blogger.comtag:blogger.com,1999:blog-4065813838796681997.post-87117538996649360762010-10-08T17:28:47.578-04:002010-10-08T17:28:47.578-04:00Thank you Darrell for the tip on F12. Its much con...Thank you Darrell for the tip on F12. Its much convenient to get an x-path. Though now, selenium says element not found when i can see the element on the develop toolbar. Missing x-path checker a lot! :( <br /><br />I am hoping , I can make my framework work with selenium + IE. Using watij is all effort again.<br /><br />So, now, I am trying to find out if the X-path in IE has any special requirements since it refuses to be found!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4065813838796681997.post-17114955957765825622010-10-08T16:50:33.642-04:002010-10-08T16:50:33.642-04:00Hi Anonymous,
If you search Google for "dev ...Hi Anonymous,<br /><br />If you search Google for "dev toolbar for ie7" you should find links to a toolbar similar to Firebug. One of the results will be a Microsoft website (in case you are worried about a trojan). At the time of writing, you can download the toolbar from http://www.microsoft.com/downloads/en/details.aspx?familyid=95E06CBE-4940-4218-B75D-B8856FCED535&displaylang=en.<br /><br />If you are using IE8 then just press F12. The development toolbar is built into IE8.<br /><br />In some cases the xpath will be different because Internet Explorer isn't complete compliant with HTML standards. In other cases, the application server will actually send different web pages to IE. A third reason for xpaths on IE being different from Firefox can be javascript. Often web pages now have javascript which detects the browser model and version then modifies the page on the client side. If you are using IIS as the application server, it will often send nonstandard HTML when it detects the browser is IE.<br /><br />You might want to go to the Watij web site. They have a new version fo Watij called WebSpec. It supports more than IE but is fairly different from the original Watij. I have not had a good look at WebSpec but it is a possibility.Darrellhttps://www.blogger.com/profile/18232752184374702137noreply@blogger.comtag:blogger.com,1999:blog-4065813838796681997.post-79605160072822954222010-10-08T16:21:41.217-04:002010-10-08T16:21:41.217-04:00Hi Darrell,
We already have a decent framework r...Hi Darrell, <br /><br />We already have a decent framework running with Selenium + mozilla. now, my application is also going to be supported on IE. Selenium and IE dont go very well together. My selenium gets hung up or cant find elements with the same x-path as on mozilla. I am also having problems finding equivalent tools like xpath checker, firebug on IE. Do you know any equivalent tools/addons/plugins etc? I was thinking of watij to be used on IE. But after your blog, i am not so sure about watij. I dont know what to do since selenium doesnt work.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4065813838796681997.post-48624933103280498162010-02-13T10:44:33.889-05:002010-02-13T10:44:33.889-05:00lol, yeah I could just do it myself then :)lol, yeah I could just do it myself then :)Jake Dempseyhttps://www.blogger.com/profile/08544185697559865724noreply@blogger.comtag:blogger.com,1999:blog-4065813838796681997.post-84791675506419177512010-02-13T10:42:37.001-05:002010-02-13T10:42:37.001-05:00Jake, the documentation at http://watij.com/usage-...Jake, the documentation at http://watij.com/usage-guide/ was a huge help when I first started using Watij and definitely something every Watij user should have readily available.<br /><br />I agree that JavaDocs can become quickly stale. I guess documentation which does not go stale is part of what you are paying for when you buy a commercial product.<br />That is, if Watij cost $5000/year you could afford to hire technical writers to maintain the documentation. :)Darrellhttps://www.blogger.com/profile/18232752184374702137noreply@blogger.comtag:blogger.com,1999:blog-4065813838796681997.post-12833300871286385812010-02-13T09:18:31.246-05:002010-02-13T09:18:31.246-05:00Do you feel that the documentation at: http://wati...Do you feel that the documentation at: http://watij.com/usage-guide/ is not adequate for testers? My goal was to provide "how" you would use watij rather than provide method level documentation in javadoc because of the inherent problem of those becoming stale.<br /><br />Yeah I was looking at JxBrowser from TeamDev to make watij multi platform, multi browser, but it doesnt look like it can fit the bill. I was thinking of also looking into webdriver and some other technologies. Its a tough one :)Jake Dempseyhttps://www.blogger.com/profile/08544185697559865724noreply@blogger.comtag:blogger.com,1999:blog-4065813838796681997.post-45505510439254269472010-02-13T00:27:43.711-05:002010-02-13T00:27:43.711-05:00Jake, the comment about lack of documentation was ...Jake, the comment about lack of documentation was relating to the lack of JavaDocs. I was talking from the point of view of someone who typically uses commerical packages like SQABasic (IBM/Rational Robot) or TSL (WinRunner). Most testers will expect documentation rather than solid programming and unit tests to explain how the code works.<br /><br />I just re-read the blog entry and realize I left out one important paragraph.<br /><br />"Watij is well documented from a programmer's perspective. The source code is self-documenting, the method names clearly tell me what they do, the classes imply what methods exist within it and the unit test cases show how the API should be used."<br /><br />I should add that the consistency of Watij API makes this sort of documentation far less important than Selenium. I also love being able to give Watij an xpath which matches multiple cells, rows, links, whatever then get back an Iterable List of those elements.<br /><br />My only major complaint about Watij is the fact it uses IE.<br /><br />I recently read about the possibility to have Watij supporting other web browsers. If this happens I will be thrilled. If there is anything I can do to help please let me know.<br /><br />I tried to figure out what the application was doing to make IE hang. I eliminated all the things people said would cause the problem. It reduce the hanging but never eliminated.<br /><br />I tried running a thread in the background that monitored the status bar. If it did not change within one minute I assumed the browser had hung and sent a refresh. This helped a little more but not enough.Darrellhttps://www.blogger.com/profile/18232752184374702137noreply@blogger.comtag:blogger.com,1999:blog-4065813838796681997.post-31682230221636844862010-02-12T17:05:50.111-05:002010-02-12T17:05:50.111-05:00Can you help us understand what "exactly"...Can you help us understand what "exactly"is lacking in the documentation of watij? Do you not find the multitude of unit tests as documentation or the documentation on the watij.com site good enough? Are you just referring to the fact that your IDE doesnt give you documentation on the fly with intellisense?<br /><br />Also its a misnomer to say watij is built on top of jUnit. Its not. You can use watij with any test runner you like. We user junit for writing our unit tests for watij, but you can use anything you like as there is no coupling to a test runner.<br /><br />I do however agree with you that IE is buggy, flakey, etc and can cause watij to hang because the actual browser is hanging as well. I have found though that the hanging can be fixed depending on the application.Jake Dempseyhttps://www.blogger.com/profile/08544185697559865724noreply@blogger.com