Showing posts with label Watir. Show all posts
Showing posts with label Watir. Show all posts
Tuesday, October 27, 2009
Thursday, August 13, 2009
I'm presenting at PNSQC
I'll be presenting at the Pacific Northwest Software Quality Conference (PNSQC) in October on "Web Security Testing with Ruby and Watir". Come say hi! It looks like I'll be presenting on Oct 27th, in the afternoon...though schedules are fluid, so don't hold me to it.
Click here to view a preliminary draft of my paper.
Click here to view a preliminary draft of my paper.
Thursday, February 26, 2009
This might be a "duh!" thing but...
it was a new concept for me. I always wondered why some of the methods in the Watir RDoc didn't have any documentation. I asked Bret Pettichord about it, and it basically the gist is that if a method isn't documented, you can assume it is a non-public interface (not to be called directly).
I'm sure this is probably how things are normally done in the programming-language world, but it was new to me. Thanks to Bret for providing this insight.
I'm sure this is probably how things are normally done in the programming-language world, but it was new to me. Thanks to Bret for providing this insight.
Wednesday, February 25, 2009
Customizing watir-console
Watir comes with a really cool command-line tool called watir-console. To start it, just type watir-console at a prompt (assuming you have the ruby\bin directory in your path). It will bring up an irb prompt, but this isn't just any irb prompt. It has already required the watir module, and offers some cool features for interactively using Watir, such as tab completion of Watir commands.
One thing you can do to make watir-console even more useful is to write a startup script. Here are the steps:
One thing you can do to make watir-console even more useful is to write a startup script. Here are the steps:
- Create a helper script and put it in one of the Ruby library directories (such as C:\ruby\lib\ruby\1.8). Let's call it helper.rb.
- Create a .irbrc file (just a text file) and store it in \ruby\bin. This is actually a Ruby file, and can have any Ruby commands you want to start up when Ruby starts. For our purposes, your script should 'require' the script you built in step 1.
That's it! Now, helper.rb (and its methods and constants) will be available in watir-console whenever you run it.
"What should I put in helper.rb", you ask? I'm a believer in examples, so here are a few examples of methods I created:
- A 'login()' method to start a browser, go to the login page for my web app and log in. It returns the IE object, so it can be called from watir-console as "instance = login()". This allows you to then access "instance" as the IE instance to be manipulated.
- Now you can run different methods to do different things. For example, my application does queries, so I have a 'new_query()' method that simply navigates to the page where I can create a query. It is accessed by calling 'new_query(instance)' from watir-console.
Saturday, February 21, 2009
Brett Pettichord working on new Watir testing framework
Brett Pettichord's latest blog post has some information on a new Watir-based testing framework. It looks pretty interesting. Since I use Watir extensively for my testing work, I have a particular interest in Brett's work.
I guess my initial question is...what exactly does it provide that Watir/RSpec doesn't? I might download and play with it some...will blog about my impressions.
I guess my initial question is...what exactly does it provide that Watir/RSpec doesn't? I might download and play with it some...will blog about my impressions.
Subscribe to:
Posts (Atom)