Chan
There are many solutions to your problem
Try this one as it works for me
require 'watir'
test_site = "http://svvarmls.rapmlsqa.com/";
ie = Watir::IE.new
ie.goto test_site
ie.text_field( :id, "txtUserName" ).set "rapstaff"
ie.text_field( :id, "txtPassword" ).set "Succ3ss!"
ie.button( :id, "btnSubmit" ).click
#ie.button( :id, "btnReadLater" ).click
table = ie.table(:id,"uwmMainMenu_MainM")
table[1][1].fire_event "onmouseover"
table[1][1].fire_event "onmousedown"
table2 = ie.table(:class, "SubMenu")
table2[7][1].fire_event "onmousedown"
table2[7][1].fire_event "onmouseup"

If your credentials contain sensitive information, I strongly recommend
changing the password as google has probably already indexed this thread

Good Luck!

Basim Baassiri

On Wed, Jul 28, 2010 at 10:34 AM, Chan Nguyen <[email protected]> wrote:

> Hello Zeljko,
> I just tried to test our website.From my understanding, Watir has to know
> the information of attribute of each element.( Eg. id, name...ect ).
> However, our website have a lot of JavaScripts that deal with each element
> in a cell of a table. By that, I mean, I can access to the "cell" of a
> table. But this "cell" also has a list of other options.
> This is the site that I'm currently testing:
>
> http://svvarmls.rapmlsqa.com/
> username: rapstaff
> pw: Succ3ss!
>
> And this is my script.
>
>
> *require "rubygems"
>
> # the Watir controller
> require "watir"
>
> # set a variable
> test_site = "http://svvarmls.rapmlsqa.com/";
>
> # open the IE browser
> ie = Watir::IE.new
>
> # print some comments
> puts "Beginning of test: Sedona Verde Valley"
>
> puts " Step 1: go to the test site: " + test_site
> ie.goto test_site
>
> puts " Step 2: enter username : rapstaff in the Agent ID field"
> ie.text_field( :id, "txtUserName" ).set "rapstaff"
>
> puts " Step 3: enter password : Succ3ss! in the Agent ID field`"
> ie.text_field( :id, "txtPassword" ).set "Succ3ss!"
>
>
> puts " Step 4: click the 'Submit' button."
> ie.button( :id, "btnSubmit" ).click
>
> puts " Step 5: after navigate to
> http://login.rapmlsqa.com/BroadcastNotices.aspx?hidMLS=SDNA, click 'Read
> Later' button "
> ie.button( :id, "btnReadLater" ).click
> *
> After clicking the "Read Later" button, it will prompt me to another page.
> In this page, from the very top, you can see there are several options:
>
> ----------------------------------------------------------------------------------
> - Search - Listing - Tax - Contact - Links - Admin - Help -
>
> ----------------------------------------------------------------------------------
> And this is a table with one row and 8 columns.
> The first element [1][1] is Search, which will call the JS to process all
> the search options. When you move your mouse over "Search", you will see all
> the others options.
>
> I want to click on each individual option of Search( Quick Search, Custom
> Search.... ) to test, but I could not find a way to make it work. If you
> have a chance, would you mind taking a look at it?
>
>
> On Wed, Jul 28, 2010 at 7:33 AM, Željko Filipin <
> [email protected]> wrote:
>
>> On Wed, Jul 28, 2010 at 3:57 PM, Chan Nguyen <[email protected]> wrote:
>> > My problem is that in our website, there are a lot of JavaScript. And I
>> currently could not find a way for Watir to deal with JS. :( !
>>
>> Our site also uses javascript and Watir works just fine. What is the
>> problem?
>>
>> Željko
>>
>> --
>>  Before posting, please read http://watir.com/support. In short: search
>> before you ask, be nice.
>>
>> You received this message because you are subscribed to
>> http://groups.google.com/group/watir-general
>> To post: [email protected]
>> To unsubscribe: 
>> [email protected]<watir-general%[email protected]>
>>
>
>  --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> You received this message because you are subscribed to
> http://groups.google.com/group/watir-general
> To post: [email protected]
> To unsubscribe: 
> [email protected]<watir-general%[email protected]>
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

Reply via email to