rubywatirwatir-webdriverweb-testingshoes

Ruby interface Shoes and auto testing tool Watir


I installed and used Watir to do auto testing for my web pages successfully. After this, I tried to create a Shoes interface for my testing code. I want to click on a button and then run my Watir testing code.

My testing code works if I run it in terminal. However, it stops at the step "require 'watir-webdriver'" if I involve Shoes. So, I can see the alerted 1 and 2, but never 3 and nothing after. My code is here:

Shoes.app do

def xxxx(from, to)

alert "1"
puts "my message abcdefg"
alert "2"
require 'watir-webdriver'
alert "3"

browser = Watir::Browser.new
browser.goto 'http://my.page.url.......'
alert "4"

# login
browser.link(:text => 'Login').click
browser.text_field(:id => 'username').set 'xxxx'
browser.text_field(:id => 'password').set 'yyyy'
browser.button(:text => 'Login').click

# some other staff... nothing wrong here

browser.close()
end

# build the interface
@s = stack :width=>200, do

    username = edit_line
    password = edit_line

    button "Login" do
        xxxx(1, 2)   # just call the function
    end
end

@left=(@s.parent.width-@s.style[:width])/2
@s.move(@left,0)

end

Am I using Shoes wrong? I don't get any error at all, but it just stopped. What other interface would you suggest? I need an interface to let the user load a txt file and then perform the testing based on the information in the file.

Thanks a lot.


Solution

  • Well, shoes won't load watir-webdriver and shoes4 has this issue 'Unable to activate selenium-webdriver-2.42.0, because rubyzip-0.9.9 conflicts with rubyzip (~> 1.0)'...

    No solution so far...