There's a lot of complicated stuff about Selenium out there, but it's actually really simple. Grig added to his previous post with a shorter description, and Jason Huggans post also had a quick start for Windows/IE. Here's my quick start:
Voila! Was that so hard? All that server instrumentation stuff, Twisted stuff, etc... really, just don't worry about that. Maybe later, but it's no place to start.
To follow a link by its text:
I haven't tried this, but maybe it would work more fuzzily:
//a[contains(text(), 'partial text')]
And for a submit button:
Anyway, hopefully we'll get this information into the documentation, and a quick start with Selenium will become more approachable.
I also started working on some infrastructure. The first is expanding and improving a script that takes tcpwatch logs and turns them into test scripts (tcpwatch_scriptgen.py). I previously generated PBP scripts (and in the future probably Twill scripts); now you can also make Selenium scripts.
Oh... and that CGI program can also turn comma-separated-value files into HTML tables, so you can write or edit your tests in a spreadsheet (which, I think, is an improvement over an HTML editor). And now tcpwatch_scriptgen.py can create both CSV files and HTML tables.
All of this, temporarily, is located in http://svn.colorstudy.com/home/ianb/webtest_experiement/ -- but it'll move someplace more permanent later. Maybe there will be a place for it in the Selenium repository, otherwise I'll put it in the Webware repository.
Great post, Ian. I was going to send you an email to suggest you post your experiences so that we can keep the Selenium momentum going, but you were one step ahead of me...Good thing I checked your blog first.
Hopefully we can combine your post with some of the stuff I wrote on the Twisted server and contribute this way to the Selenium documentation.
This is great stuff! :-) The Selenium project is benefiting immeasurably now that we've caught the attention of Ian and Grig!
Thanks for the quick start. It is sooo fast to get started using this software. I wish the docs were clearer on that because most people want to dive in and start using it and worry about Twisted later. This post shows how easy it is!
One thing: if you want to click by partial text you should use
//a[contains('partial text',text() )]
as the Xpath expression, and it works like a charm.# anonymous
sorry I was wrong with my XPath expression too, haven't figured it out yet.
OK I got it for real this time, sorry about cloggin up your blog feel free to remove my old comments
To test for a partial text, the proper XPAth expression should be: //a[contains(., 'partial text')]