[wtr-general] Application not loaded

2009-01-12 Thread Prince3105

Hi Experts,

I use below code to log  the application, some time application hangs
to load, that time test also gets hang and lets to fail.

@ie1 = Watir::IE.new
@ie1.goto $url
@ie1.maximize

@ie1.text_field(:name,txtUserName).set $userid
@ie1.text_field(:name,txtPassword).set $password
@ie1.button(:name,btnSubmit).click

Just i want to alter my code like below

@ie1 = Watir::IE.new
@ie1.goto $url
@ie1.maximize

timer = 0

while password field is not exist
  sleep 1
  timer+=1
if timer == 20 then
   Watir::IE.close_all()
@ie1 = Watir::IE.new
@ie1.goto $url
@ie1.maximize
end
end


but i cant achieve it , it hangs in the particular @ie1.goto $url line
and wont move to the next line.

please give me a solution.

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Application not loaded

2009-01-12 Thread Bret Pettichord

It sounds like you may have encounted a bug in goto that occurred with 
an old version of Watir. What version are you using?

Prince3105 wrote:
 Hi Experts,

 I use below code to log  the application, some time application hangs
 to load, that time test also gets hang and lets to fail.

 @ie1 = Watir::IE.new
 @ie1.goto $url
 @ie1.maximize

 @ie1.text_field(:name,txtUserName).set $userid
 @ie1.text_field(:name,txtPassword).set $password
 @ie1.button(:name,btnSubmit).click

 Just i want to alter my code like below

 @ie1 = Watir::IE.new
 @ie1.goto $url
 @ie1.maximize

 timer = 0

 while password field is not exist
   sleep 1
   timer+=1
 if timer == 20 then
Watir::IE.close_all()
 @ie1 = Watir::IE.new
 @ie1.goto $url
 @ie1.maximize
 end
 end


 but i cant achieve it , it hangs in the particular @ie1.goto $url line
 and wont move to the next line.

 please give me a solution.

 Thanks


 
   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: element_by_xpath return value

2009-01-12 Thread Bret Pettichord

Richard Lawrence wrote:
 Using FireWatir's element_by_xpath on my Mac, I get the expected type
 for the element. For example, on the Google home page:

 irb(main):008:0 b.element_by_xpath(//*...@name='btnG']).class
 submit
 = FireWatir::Button

 But with Watir (on Windows, of course), I always get an instance of
 WIN32OLE back. For the same example:

 irb(main):018:0 b.element_by_xpath(//*...@name='btnG']).class
 = WIN32OLE

 Is there a way I can get the Button object I expect from
 element_by_xpath with Watir?

   
b.button(:xpath, //*...@name='btnG'])

This actually wraps the call to element_by_xpath.

Bret

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: watir click_no_wait hangs my code

2009-01-12 Thread Michael Hwee
I don't think that is true.
click_no_wait() does not wait for the popup.

Need more info on your issue.





From: wesley chen cjq@gmail.com
To: watir-general@googlegroups.com
Sent: Monday, January 12, 2009 12:12:14 AM
Subject: [wtr-general] Re: watir click_no_wait hangs my code

If you write the code as above, you can never print out the text.
The click_no_wait method is waiting for a pop up, if no pop up, it will wait 
all the time.

Thanks.
Wesley Chen.



On Mon, Jan 12, 2009 at 3:30 PM, mbaruah oss.mand...@gmail.com wrote:


In my ruby(1.8.6)/watir code I am currently making use of
click_no_wait

When I execute the following code
--
puts before click
ie.link(:text, /#{pattern}/).click_no_wait
puts after click
--

before click gets printed, the text link is clicked BUT after that
the script just hangs.
after click never gets printed out.

Earlier when I wrote the script, it worked just fine. But suddenly now
the script just hangs
because of this click_no_wait. Did anyone come across this problem
earlier.
Please help!





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Full Screen [F11] FireFox

2009-01-12 Thread al3kc

Try to send F11 by AutoIt
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] How to Verify Name in File download popup

2009-01-12 Thread zeng0...@gmail.com

I have a File download popup window looks the same as in
http://wiki.openqa.org/display/WTR/File+Downloads

I wonder if there is a way to check the Name and Type text on this
window.

Any suggestions are appreciated!

Jun

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to Verify Name in File download popup

2009-01-12 Thread Bill Agee

AutoIt may be able to do what you want.  Check out the WinGetTitle and
WinGetText functions:

http://www.autoitscript.com/autoit3/docs/functions/WinGetTitle.htm

http://www.autoitscript.com/autoit3/docs/functions/WinGetText.htm

There should be some code examples in the wtr-general archives showing
how to use those functions within Ruby scripts.  If you can't find
anything useful, just reply back and I'll see if I can write an
example.

Thanks
Bill


On Mon, Jan 12, 2009 at 1:35 PM, zeng0...@gmail.com zeng0...@gmail.com wrote:

 I have a File download popup window looks the same as in
 http://wiki.openqa.org/display/WTR/File+Downloads

 I wonder if there is a way to check the Name and Type text on this
 window.

 Any suggestions are appreciated!

 Jun

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Best Way for Checking Name Fields?

2009-01-12 Thread gem dandy

Rob,

Give the below script a  try. It puts 'whatever ' (with trailing
space)
into a text box in this thread and then checks to see if it contains
'whatever' (no trailing space).


***

=begin
##
This is a short test to reveal the text in a entry
box what is expected (or not expected).
##
=end

require 'watir/ie'
require 'watir/WindowHelper'
require 'test/unit'
require 'win32ole'


# open a browser
$ie = Watir::IE.new


$ie.goto(http://groups.google.com/group/watir-general/browse_thread/
thread/2751583d3eb37e50)
$ie.form(:name, 'gs2').text_field(:name, 'q').set('\'whatever \'')

# Flash the table cell System Name text
$ie.form(:name, 'gs2').text_field(:name, 'q').flash

# Reveal the System Name text
myValue = $ie.form(:name, 'gs2').text_field(:name, 'q').value

puts My value is   + myValue
sleep 1

  if (myValue == whatever)
 puts Test passed
  else
puts Test failed
  end
sleep 5

$ie.close

***
Let me know if you have any problems. good luck,
Gem Dandy



On Jan 11, 9:26 pm, rob rs...@verizon.net wrote:
 I have several forms that have

 name='whatever '

 within the tag.  Notice the trailing [space] after the word whatever.
 What would be the best way to check every tag on the page that has
 name='whatever ' to ensure there is no trailing space.  If there is a
 space, I will throw an error message.

 Any help is appreciated.  Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to deal with two security information pop-up with Watir script?

2009-01-12 Thread wesley chen
Excellent! When I follow your advise and change the setting, both the two
security pop ups are avoided, :),

Really appreciate to you.

Thanks.
Wesley Chen.


On Tue, Jan 13, 2009 at 1:52 AM, Michael Hwee michael_h...@yahoo.comwrote:

 Wesley,
 Just set the configuration to get rid of it.

 Goto: Internet Options  Security Settings  Miscellaneous  Display mixed
 content == 'Enable'

 Michael

 --
 *From:* wesley chen cjq@gmail.com
 *To:* Watir General watir-general@googlegroups.com
 *Sent:* Sunday, January 11, 2009 10:24:25 PM
 *Subject:* [wtr-general] How to deal with two security information pop-up
 with Watir script?

 Hi, All,
 Would anyone of you ve interested in the Security Pop up?
 I think you can deal with all the Security Pop up issues if you can solve
 the question below.
 Expect you could help.

 Please use IE browser.
 1. Please goto URL: http://training.active.com/ActiveTrainer/
 There will be with Security Information pop up
 We have to achieve clicking Yes
 2. Please input account information:
 tes...@live.com
 11
 There will be with another Security information pop up before you login the
 system
 We have to achieve clicking Yes again.

 How to achieve the whole process with Watir Script?
 Open a browser -- Input the URL -- click Yes on Security Pop up ---
 Input account information --- click Yes again on the Security Pop up.

 Appreciated to your help.
 Thanks.
 Wesley Chen.



 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Please help - getting error 'Unable to locate element'

2009-01-12 Thread H2006

Actually adding 'require 'rubygems' , solved the above problem but
then I am getting error,

 undefined method `frame' for nil:NilClass (NoMethodError) I also
tried to run from irb and got the same error.

$ie.frame(:index, 4).link(:text, 'My').flash
$ie.frame(:index, 4).link(:text, 'My').click

Can someone help, pls??



On Jan 12, 5:42 pm, H2006 hemali2...@gmail.com wrote:
 I tried to use web metrics but now I am getting different error
 message,

 C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
 `gem_original_require': no such file to load

 Can someone help??

 On Jan 12, 3:34 pm, Darryl L. Brown d-l-br...@roadrunner.com
 wrote:

  Hello,

  Glad that I could help.

  Gem Dandy

 H2006 wrote:
   Hi Dandy,

   first, Thank you so much for the information. I am currently using IE
   developer toolbar. when I click on find element and click on the text
   field, it is highlighted  but script does not recognize it. my
   application only works on IE so fire bug will not help. Let me try out
   the Webmetrics, if that helps.. I really appreciate the information
   that you have provided.

   -H2006

   On Sat, Jan 10, 2009 at 6:04 AM, gem dandy d-l-br...@roadrunner.com
   mailto:d-l-br...@roadrunner.com wrote:

   Hello H2006,

   If you can't identify the element with the IE Developer toolbar
   or Firebug (my favorite), Give Webmetrics a try. It's basically
   a Watir recorder /helper and will get you started.

   The tool download -
  http://www.webmetrics.com/products/script_recorder.html

   You will also need to apply this patch after installing the tool -
  http://www.webmetrics.com/scriptrecorder/vs_piaredist.exe

   I feel your pain. I was a Watir virgin 6 weeks ago.

   Take a look at this post for some links to some very good
   material for newbies-
  
   http://groups.google.com/group/watir-general/browse_thread/thread/811...

   Regards,
   Gem (newbie) Dandy
   --Walk before you run

   On Jan 10, 2:42 am, Anna Gabutero a...@lavabit.com
   mailto:a...@lavabit.com wrote:
Hi,

On Fri, Jan 09, 2009 at 06:23:32PM -0800, H2006 wrote:

 Hello,

 I am newbie to Waitr  Ruby. I am testing windows application that
 works only on IE. I am exploring some front end automation
   tool and
 found Watir might be the great choice. I have followed the
   tutorial
 and simple google search test and it works fine. I am so
   excited to
 use this tool for my web application
 But the problem I am facing is when i tried to create simple
   search
 for my test application, i am getting ' Unable to locate' error..
 Same error appears with all possible methods that i tried
 ( ex: .click, .flash, .set etc..) Only .exists? and
  .include command works in my script.

 Can anyone help me? Am I missing anything for installation? Do
   I need
 to add anything else other than  require 'watir'  in the
   beginning
 of my script?

 Watir version: 1.6.2
 Ruby version  1.8.6

 Error:  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
 element.rb:52:in `assert_exists': Unable to locate element,
 using :id, /txtSegSearch/
   (Watir::Exception::UnknownObjectException)
 

Watir simply can't find the element based on the criteria you
   gave it.
The .exists? method works because it only checks for the
   existence of
the element, but it's probably returning false.  Maybe this
   text field
isn't in the frMain frame?

If you're having trouble with the structure of the document you're
testing, you can use the IE developer toolbar to help you
   understand it.

HTH,
Anna

   

   No virus found in this incoming message.
   Checked by AVG -http://www.avg.com
   Version: 8.0.176 / Virus Database: 270.10.6/1889 - Release Date: 
   1/12/2009 8:18 PM
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: element_by_xpath return value

2009-01-12 Thread Bret Pettichord

I'm sure there's a way for Watir to do this just like FireWatir. It just 
hasn't been done yet, as far as i am aware.

Angrez is the author of both Watir's xpath support as well as FireWatir, 
so that is probably why xpath works better with FireWatir than WatirIE.

Angrez, do you have anything to add here?

Bret

Richard Lawrence wrote:
 But there's no way for Watir to infer the object type the way FireWatir does?

 Thanks,

 Richard

 On Mon, Jan 12, 2009 at 9:15 AM, Bret Pettichord b...@pettichord.com wrote:
   
 Richard Lawrence wrote:
 
 Using FireWatir's element_by_xpath on my Mac, I get the expected type
 for the element. For example, on the Google home page:

 irb(main):008:0 b.element_by_xpath(//*...@name='btnG']).class
 submit
 = FireWatir::Button

 But with Watir (on Windows, of course), I always get an instance of
 WIN32OLE back. For the same example:

 irb(main):018:0 b.element_by_xpath(//*...@name='btnG']).class
 = WIN32OLE

 Is there a way I can get the Button object I expect from
 element_by_xpath with Watir?


   
 b.button(:xpath, //*...@name='btnG'])

 This actually wraps the call to element_by_xpath.

 Bret

 

 
   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Please help - getting error 'Unable to locate element'

2009-01-12 Thread Alex Collins

That means that your $ie variable is nil. Which in turn means that you  
haven't successfully started a browser.

You should have a line like:
$ie = Watir::Browser.new

This line starts the browser and connects it to $ie variable for you  
to use. The open() method may be used instead, I believe.

If the webmetrics recorder has not been updated to Watir 1.6 then the  
line might read:
$ie = Watir::IE.new

If this is the case you will either need to downgrade Watir or modify  
the script.

If you are still having difficulties, it would be helpful to see your  
script code.

Alex

On 13 Jan 2009, at 02:01, H2006 hemali2...@gmail.com wrote:


 Actually adding 'require 'rubygems' , solved the above problem but
 then I am getting error,

  undefined method `frame' for nil:NilClass (NoMethodError) I also
 tried to run from irb and got the same error.

 $ie.frame(:index, 4).link(:text, 'My').flash
 $ie.frame(:index, 4).link(:text, 'My').click

 Can someone help, pls??



 On Jan 12, 5:42 pm, H2006 hemali2...@gmail.com wrote:
 I tried to use web metrics but now I am getting different error
 message,

 C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
 `gem_original_require': no such file to load

 Can someone help??

 On Jan 12, 3:34 pm, Darryl L. Brown d-l-br...@roadrunner.com
 wrote:

 Hello,

 Glad that I could help.

 Gem Dandy

 H2006 wrote:
 Hi Dandy,

 first, Thank you so much for the information. I am currently  
 using IE
 developer toolbar. when I click on find element and click on the  
 text
 field, it is highlighted  but script does not recognize it. my
 application only works on IE so fire bug will not help. Let me  
 try out
 the Webmetrics, if that helps.. I really appreciate the information
 that you have provided.

 -H2006

 On Sat, Jan 10, 2009 at 6:04 AM, gem dandy d-l- 
 br...@roadrunner.com
 mailto:d-l-br...@roadrunner.com wrote:

Hello H2006,

If you can't identify the element with the IE Developer toolbar
or Firebug (my favorite), Give Webmetrics a try. It's basically
a Watir recorder /helper and will get you started.

The tool download -
   http://www.webmetrics.com/products/script_recorder.html

You will also need to apply this patch after installing the  
 tool -
   http://www.webmetrics.com/scriptrecorder/vs_piaredist.exe

I feel your pain. I was a Watir virgin 6 weeks ago.

Take a look at this post for some links to some very good
material for newbies-
   http://groups.google.com/group/watir-general/browse_thread/thread/811 
 ...

Regards,
Gem (newbie) Dandy
--Walk before you run

On Jan 10, 2:42 am, Anna Gabutero a...@lavabit.com
mailto:a...@lavabit.com wrote:
 Hi,

 On Fri, Jan 09, 2009 at 06:23:32PM -0800, H2006 wrote:

 Hello,

 I am newbie to Waitr  Ruby. I am testing windows application  
 that
 works only on IE. I am exploring some front end automation
tool and
 found Watir might be the great choice. I have followed the
tutorial
 and simple google search test and it works fine. I am so
excited to
 use this tool for my web application
 But the problem I am facing is when i tried to create simple
search
 for my test application, i am getting ' Unable to locate' error..
 Same error appears with all possible methods that i tried
 ( ex: .click, .flash, .set etc..) Only .exists? and
  .include command works in my script.

 Can anyone help me? Am I missing anything for installation? Do
I need
 to add anything else other than  require 'watir'  in the
beginning
 of my script?

 Watir version: 1.6.2
 Ruby version  1.8.6

 Error:  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
 element.rb:52:in `assert_exists': Unable to locate element,
 using :id, /txtSegSearch/
(Watir::Exception::UnknownObjectException)
 

 Watir simply can't find the element based on the criteria you
gave it.
 The .exists? method works because it only checks for the
existence of
 the element, but it's probably returning false.  Maybe this
text field
 isn't in the frMain frame?

 If you're having trouble with the structure of the document you're
 testing, you can use the IE developer toolbar to help you
understand it.

 HTH,
 Anna

 --- 
 --- 
 --

 No virus found in this incoming message.
 Checked by AVG -http://www.avg.com
 Version: 8.0.176 / Virus Database: 270.10.6/1889 - Release Date:  
 1/12/2009 8:18 PM
 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general