tag:blogger.com,1999:blog-9390811.post96995861206287557..comments2024-03-26T09:19:44.679+00:00Comments on Ad-Hockery: Testing Grails Apps With Selenium-RCRobhttp://www.blogger.com/profile/01855523354151116481noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-9390811.post-24093800743323078362010-06-10T14:03:14.016+01:002010-06-10T14:03:14.016+01:00Hi Rob,
I am new in Automation world.
I am trying...Hi Rob, <br />I am new in Automation world.<br />I am trying to automate my grail based application by using grails-plugin selenium rc.<br />I faced 2 challenging points are<br />1)how to setup Testdata.<br />I wanted to use excel for that.But couldn't find any luck in groovy.there is many options in Java.So could you suggest me on this.For time being i m just using Property file(JAVA) to parametrized selenium testcases.<br /><br />2)How to verify displayed data from database.<br />Today I tried it by GORM in selenium testcases.It works.<br />But on net i found it will raise issue when Domain become complex.is there any other way to do so.Please suggest.Infinityhttps://www.blogger.com/profile/14662636466661159237noreply@blogger.comtag:blogger.com,1999:blog-9390811.post-82563933704876958352009-11-15T09:46:57.219+00:002009-11-15T09:46:57.219+00:00I've added some examples of how to use the pag...I've added some examples of how to use the page object pattern to the sample projects in the selenium-rc plugin. It's a really powerful and simple technique and it's once you start using that you really see the productivity gain of RC over record-and-playback selenese tests.Robhttps://www.blogger.com/profile/01855523354151116481noreply@blogger.comtag:blogger.com,1999:blog-9390811.post-25360336626125006782009-09-15T15:31:50.571+01:002009-09-15T15:31:50.571+01:00Using Selenium RC opens the door to using the Page...Using Selenium RC opens the door to using the Page Object pattern, described here:<br /><br />http://code.google.com/p/webdriver/wiki/PageObjects<br /><br />Searching for it today I also found this presentation:<br />http://www.slideshare.net/dantebriones/using-the-page-object-pattern<br /><br />This gives you a systematic way of testing against a logical view of pages. Minor changes in pages only impact the page object for the affected pages - the tests using the page object are unaffected. This counters the common argument that "it's not worth investing in automated testing until the design is stable".Unknownhttps://www.blogger.com/profile/11377225106081742537noreply@blogger.comtag:blogger.com,1999:blog-9390811.post-5651330511625472532009-09-15T09:16:59.990+01:002009-09-15T09:16:59.990+01:00That's true. I would still consider it a small...That's true. I would still consider it a small price to pay, though.Robhttps://www.blogger.com/profile/01855523354151116481noreply@blogger.comtag:blogger.com,1999:blog-9390811.post-57892411010514577662009-09-14T19:34:06.922+01:002009-09-14T19:34:06.922+01:00The one objection people have raised that I can...The one objection people have raised that I can't answer is that the Selenium IDE is a very convenient way to run single selenium commands (or manually run a few in a row). Not sure that this is really avoidable - break points Java/Groovy can do, but just executing one line of code in isolation is a bit more difficult!Robert Elliothttps://www.blogger.com/profile/08627561573144215569noreply@blogger.comtag:blogger.com,1999:blog-9390811.post-19752002500475693202009-09-14T17:59:43.163+01:002009-09-14T17:59:43.163+01:00I've been emailing back & forth with Peter...I've been emailing back & forth with Peter Ledbrook today who was about to embark on working on amending the existing selenium plugin to use RC. It would be great to have Selenium as a "first class" functional testing option for Grails along with Webtest and G-Func. Stay tuned!Robhttps://www.blogger.com/profile/01855523354151116481noreply@blogger.comtag:blogger.com,1999:blog-9390811.post-11865969117494621052009-09-14T17:38:17.679+01:002009-09-14T17:38:17.679+01:00Oh, and another positive - no having to remember t...Oh, and another positive - no having to remember to update allProjectTests.xml if you add or rename a test. It's all too easy to have orphaned tests knocking around. Of course we could improve the selenium plugin to generate the suite auto-magically - but why bother when every tool under the sun auto-generates JUnit suites from naming conventions in known directories?Robert Elliothttps://www.blogger.com/profile/08627561573144215569noreply@blogger.comtag:blogger.com,1999:blog-9390811.post-50666129269950631332009-09-14T17:36:41.784+01:002009-09-14T17:36:41.784+01:00I've been trying to persuade our team to do th...I've been trying to persuade our team to do this for ages! In addition to your points, some other positives from writing them in Java/Groovy and using JUnit:<br /><br />1) Easy to organise and find your tests - no list of 300+ files in a single selenium suite, you can put them in packages and run a single test, single test class or a package or multiple packages very easily with a right click.<br /><br />2) Easy tear down - if a "normal" selenium test fails half way through and leaves a fixture in a deliberately broken state it's going to break all the other tests that run after it. In JUnit you can do a tearDown to fix it despite the fail.<br /><br />3) More natural to use other technologies to do functional testing - for instance our reliance on selenese for all functional testing has resulted in us writing gruesome tests and fictures to drive a RESTful JSON service via Selenium and the browser; I'm sure if we were writing our functional tests in JUnit we'd immediately have spotted the mismatch and used a REST client in groovy instead.<br /><br />But the single biggest point is that as you say, selenese makes it very, very difficult to write well factored code. The other day we changed the id of a submit button used in perhaps 60% of our tests. Complete nightmare to fix all the selenium tests, because we'd never bothered to abstract away submitting the form because writing selenium extensions in javascript is too painfulRobert Elliothttps://www.blogger.com/profile/08627561573144215569noreply@blogger.comtag:blogger.com,1999:blog-9390811.post-5751856651791931612009-09-14T16:16:57.617+01:002009-09-14T16:16:57.617+01:00This is fantastic! I have a brutal process for ru...This is fantastic! I have a brutal process for running selenium RC tests right now and have been hoping for a Selenium RC plugin to make it easy with Grails - can't wait to try it out!Mike Hugohttps://www.blogger.com/profile/09374812748351012788noreply@blogger.com