First of all you need to install Watir-Webdriver gem on your
machine. It’s pretty simple.
Installing
watir-webdriver gem
- Open command prompt.
- Type “gem install watir-webdriver”
- You should see a confirmation message that it is installed.
Steps to include
the support for watir-webdriver in you scripts
1. Open Aptana Studio.
2. Create a new project if you don’t have one
already
a.
Right click on left hand pane of Aptana
b.
Move cursor over “New”
c.
Move cursor over “Ruby Project”
d.
Select “Default Project” from New Project
window. Click Next button.
e.
Let the defaults stay for all the fields but
enter a suitable project name in Name filed. Click Finish button.
3. Create a new ruby file
a.
Right click on left hand pane of Aptana
b.
Move cursor over “New From Template ”
c.
Move cursor over “Ruby”
d.
Move cursor over “Blank File”
e.
Enter a suitable name to your script. Make sure
you have “.rb” as extension while adding the name to the script. Click finish.
4. Open script that you have just created from left hand pane.
5. Type the following line of code on top of your
script
require “watir-webdriver”
Note: In ruby if we install a gem(library),
we can add it to any of our scripts using “require” keyword followed by
gem(library) name in quotes.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw-MvC_u9zIBB_IcOTKUg0oJ37fMwiaKJiiCzI5iyZ-IR8J26H1CWII-9v8ROLVY8J5TkL4HtppNHx07XZ-PBmdtWT0QfOleCo52gCr5MwPXIqMgTn74fUsEKuvllNbhQkE_Zl71YIRA/s1600/installwatir6.png)
6. Now to verify that watir-webdriver is added to
your script, just click on run
button on Aptana Studio tool panel.
If you see any errors in console, this
would mean you did something wrong while configuring or installing
watir-webdriver.
7. You don’t believe if technique mention in step 6
is working or not, do you ?
OK let’s clarify our doubt.
Type ‘require howdy’ and click on play
button. You would see some errors in console. Now you can confidently believe
that technique at step 6 is working and is a proof that watir-webdriver is
successfully added to script.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTfz8RIMlg2K48xEPUVp-wjqy6kY6iDMM_j1TayYGHtZ_081B6aMlnB4VxP5-KEJQw6w2MMbEWy2buuSbJ0YbpdZNXhtyvWjcS-h6JKz8EF96sprz_0aq3KfAxhHr4MI2AEKNBgwn4pg/s1600/installwatir8.png)
That's all for this session. See you again in next session.
Happy Testing :) :)
Shiva Krishna Imminni
To sponsor my work and help maintain this site please contact me.
Shiva Krishna Imminni
To sponsor my work and help maintain this site please contact me.