It's very amusing to see two people post in two different threads, the
exact same script.    Are you folks taking a class that uses Watir ?

FWIW I'm not sure if it will solve the problem you are having on 'this
system' vs 'other system'  but the way you are going about the script
is a bit convoluted (setting a variable then executing the method) and
not typical of how most of us do Watir scripts in Ruby.  Most of us
would do it something more like this.

require "watir"
url="www.google.co.in"
search_phrase = "Delhi"
browser=Watir::IE.new

browser.bring_to_front
browser.maximize
browser.goto(url)
browser.text_field(:name,"q").set(search_phrase)
browser.button(:name,"btnG").click
sleep(2)
browser.close

Also, since this is not checking for any kind of result, I'd
personally not call this a 'test'  as nothing is being tested.

If things are working on one system but not another, then there is
likely something different about the configuration of the systems.

Are there any error messages?  if so what are they

Do these steps work if you type (or copy-paste) them into an IRB
session?  If so it might be a timing issue, you might need a tiny
sleep to let the page finishe rendering before you try to populate the
text box with your search phrase

On Jun 21, 4:52 am, Zubair <[email protected]> wrote:
> Hi,
> I have written an script like:-
> 1)Open Webbrowser
> 2)Open Google.com
> 3)Now setText on the textBox then
> 4)Click on the Button.
>
>       my problem is that Text is not being set into the TextBox, and
> if i am runnig this Script on the other system, it is working
> properly.
>      I have reinstall Ruby many times but problem still persist.
> my Script is:
> ----------------------------
> require "watir"
> url="www.google.co.in"
> ie=Watir::IE.new
> ie.bring_to_front
> ie.maximize
> ie.goto url
> t=ie.text_field(:name,"q")
> t.set("Delhi")
> b=ie.button(:name,"btnG")
> b.click
> sleep(2)
> ie.close
> ----------------------------------
> Please tell me the Proper solution

-- 
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