Re: [Wtr-general] How to check for the presence of a frame in a page?

2007-05-24 Thread Ameya
you can try and use ie.showframes 
this will display the names of all frames on the  page. If this doesnt work , 
then add the site url that has frames to the trusted sites in the IE internet 
options - Security and then try ie.showframes again.
all da best :)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Why it is always failed?

2007-05-24 Thread Željko Filipin

On 5/23/07, Kui Zhang [EMAIL PROTECTED] wrote:


Got it.  Thanks Zeljko!



You are welcome. But, actually Paul answered your question. :)

Zeljko
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] ie-new-process and rubyw.exe? bug?

2007-05-24 Thread Željko Filipin

On 5/24/07, Norm [EMAIL PROTECTED] wrote:


What is the trunk version of watir?



Hi Norm,

Take a look at this.

http://openqa.org/watir/cvs.action

Zeljko
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] ie-new-process and rubyw.exe? bug?

2007-05-24 Thread Bret Pettichord
Norm wrote:
 Arg, same thing on my other computer. Must be a bug in the version of watir I 
 am using. Looking at CVS it looks like the ie-new-process has had a lot of 
 changes... I guess I'll wait for the next gem to be released and try a new 
 build, until then I'll have to live with the stray console windows I 
 suppose...
   
None of the changes should make a difference for the issues you are having.

Have you reproduced the problem running ruby from the command line? Or 
have you only tried launching ruby from another tool (e.g. an editor or 
ide)?

 Does anyone know of a way to install watir (gem) to the same directory 
 everytime? For example instead of 
 C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1164 just use 
 C:\ruby\lib\ruby\gems\1.8\gems\watir? That would be HUGE for me.
   
The answer is that you would have to manually install watir instead of 
using the gem system. But you shouldn't be doing this unless you already 
know what you are doing -- in which case you wouldn't be asking us the 
question.

Why do you care where Watir is installed?

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] want to enter URL manualy

2007-05-24 Thread Charley Baker

Hi Shalini,

 There shouldn't be a need to use $ie.wait

$ie = IE.new   # creates a new browser window

Now you can enter your url manually if you want. How is this not working?

-Charley

On 5/24/07, SHALINI GUPTA [EMAIL PROTECTED] wrote:


Hi all,

I want to enter URL in address bar of my project manually.so i have tried
this
$ie=IE.new()
$ie.wait()

But previously it was working but now its not working.
i have changed my watir version from 1.5.1127 to 1.5.1166

is it the problem??

Please help
Thanks In advance!!

Regards
Shalini Gupta

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] CAN BE CLICK LINK ASSOCIATED WITH AN IMAGE

2007-05-24 Thread Bret Pettichord
Željko Filipin wrote:
 On 5/24/07, *Bret Pettichord* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 ie.link(:after, ie.image(:id, 'foo')).click


 Bret, this does not work for me. Am I doing something wrong?
My mistake. Try this instead.

ie.link(:after?, ie.image(:id, 'foo')).click



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] Question about IE.new_process and Vista

2007-05-24 Thread Bach Le
I've installed watir 1165 and tried using IE.new_process on Windows Vista and 
in both tests and irb, IE.new_process fails. It fails after creating the window 
when it tries to get the process id from hwnd. 

I have a coworker who installed this on his Vista machine and it works fine. 


The problem is that Shell.Application.windows does not get all of the windows 
but just the ones that are browsing the file system so the IE windows do not 
show up in this list. It ends up doing in an infinite loop and never breaks out 
of it.


Does anyone have any idea how to fix this?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Question about IE.new_process and Vista

2007-05-24 Thread Bret Pettichord
Bach Le wrote:
 I've installed watir 1165 and tried using IE.new_process on Windows Vista and 
 in both tests and irb, IE.new_process fails. It fails after creating the 
 window when it tries to get the process id from hwnd. 

 I have a coworker who installed this on his Vista machine and it works fine. 


 The problem is that Shell.Application.windows does not get all of the windows 
 but just the ones that are browsing the file system so the IE windows do not 
 show up in this list. It ends up doing in an infinite loop and never breaks 
 out of it.


 Does anyone have any idea how to fix this?
   
Thanks for the report. I've logged this as 
http://jira.openqa.org/browse/WTR-156

I am in the process of migrating this functionality into core watir and 
would like to get problems like this fixed.

I guess the next step is to figure out why the Shell.Application windows 
are not including any of the IE windows. That is definitely a problem, 
and, as stated, would be a core MS bug.

The other possibility might be that it actually is showing up in this 
list, but there could be a flaw in the logic we are using to decide 
whether it is an IE window or not (there have been other flaws in the past).

Bret
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Question about IE.new_process and Vista

2007-05-24 Thread Bach Le
Bret, the problem actually exists for IE.new as well. I create a new IE window 
with IE.new and it creates the window but when I call the goto method to 
navigate to any page, a new IE window shows up and the navigation is done in 
that window.


I've updated the ticket to include this information.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] watir, rspec, screen shots

2007-05-24 Thread Chris McMahon
Aslak Hellesoy's been working with Watir:
http://blog.aslakhellesoy.com/2006/12/2/getting-screenshots-from-watir
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] ie-new-process and rubyw.exe? bug?

2007-05-24 Thread Norm
Bret, I was simply thinking of upgrading because changes were made, and you 
said it was working for you on the CVS trunk build, I didn't go line by line 
or anything and try to see if there was a change that I thought would fix the 
issue.

I have tried running ruby from the command line, same problem: rubyw.exe 
script.rb

I have manually installed watir before, but had problems, everyone said to use 
the gem method, I did, and it worked. So I haven't tried installing manually 
since.

--

The reason I want the directory to stay the same is that I run all of my 
scripts from that directory currently, and I have a complex environment in 
place, so that when the directory path changes, and I re-install my scripts 
(various scripts, not just ruby), I have to update about 30 different locations 
of that directory path. I mean, it only takes like 10 minutes, but it would be 
nice to not have to do it (I have lots of shortcuts, etc).

If I could figure out a way to get a script to run outside of the watir 
directory (like off of C:\Scripts) without failing due to  `require': no such 
file to load -- watir (LoadError), then I could store my scripts outside of 
the watir directory and it wouldn't matter. I have been trying things all 
morning, still no luck.

I tried using RUBYOPT=rubygems env variable, RUBYOPT=-rubygems (found it both 
ways online). 

I got it to kind of work when I used the following:

require 'rubygems'
require_gem 'watir'

However, I also use:

require 'watir/contrib/ie-new-process' 
require 'win32ole'

and they still bomb out. I can get around it by specifying the full path, but 
that is the point, not relying on that directory path...

I've been searching the forums for a solution, so if anyone has an idea that 
would be awesome. I just want to be able to house/run my ruby scripts from a 
different location than the watir gem install folder...
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] ie-new-process and rubyw.exe? bug?

2007-05-24 Thread Norm
Weird, this is working now:

require 'rubygems'
require_gem 'watir'
require 'win32ole'
require 'watir/contrib/ie-new-process' 

So I guess that's 1 problem solved. Now I can try installing a different 
version of watir to see if my problem with ie-new-process and rubyw goes away...
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Question about IE.new_process and Vista

2007-05-24 Thread Bret Pettichord
Bach Le wrote:
 Bret, the problem actually exists for IE.new as well. I create a new IE 
 window with IE.new and it creates the window but when I call the goto method 
 to navigate to any page, a new IE window shows up and the navigation is done 
 in that window.


 I've updated the ticket to include this information.
Why do you think the two problems are related?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Seg-faults with 4 ie windows (hello)

2007-05-24 Thread Michael Sofaer
Thanks for looking at this, Bret.

I tried running the script you included on my machine, it hangs at
around 33 windows, but doesn't crash. Here is the stack trace from the
interrupt, for what it's worth:

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-p
rocess.rb:44:in `window': Interrupt
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-p
rocess.rb:43:in `each'
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-p
rocess.rb:43:in `window'
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir/contrib/ie-new-p
rocess.rb:67:in `new_process'
from C:/test/Watir/modeln/bret.rb:8
from C:/test/Watir/modeln/bret.rb:6:in `times'
from C:/test/Watir/modeln/bret.rb:6

I also need to explicitly include 
require 'watir/contrib/ie-new-process'
in order to get the script to run, but I expect that will change in the
next gem release.

As far as threading, here is what I've been doing:
stack = []
threads = []
num_threads.times do |i|
   stack.push Thread.new {threads[i] = test.repeat(num_runs) }
   sleep 4
   end
stack.each {|thread| thread.join}

-Michael
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bret Pettichord
Sent: Wednesday, May 23, 2007 8:21 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Seg-faults with 4 ie windows (hello)

Michael Sofaer wrote:
 Thanks, Chris

 I don't think that it's the machine running out of memory, 8 windows
is
 taking about 150 MB of the 270 MB I have available before I get the
seg
 fault. Closing additional expensive processes doesn't improve the
number
 of windows I can run. Could I be running into a memory limit inside
Ruby
 or Watir?

 Thanks for the recommendation for Grinder, I will look into that,
 although the app is pretty back-end intensive per user, so I hope to
be
 OK for a bit with Watir.

   
Michael,

Thank you for your report. I'm am sorry to hear of the problems you 
reported. The following script repeatedly failed for me after 30 windows

were opened, although i was not able to reproduce the SIGSEGV that you 
reported. In my case, I got errors telling me that Internet Explorer 
itself had failed.

Bret

require 'watir'

@ie = []

50.times do | n |
  puts n; $stdout.flush
  @ie  Watir::IE.new_process
end

@ie.each {|ie| ie.close}

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] ie-new-process and rubyw.exe? bug?

2007-05-24 Thread Norm
Nope. I upgraded to 1.5.1.1166 and when I change the .rb file extension to use 
rubyw.exe instead of ruby.exe it still fails:

c:\ruby\bin\ruby.exe %1 %*

to

c:\ruby\bin\rubyw.exe %1 %*



What happens is that after it opens the browser (using ie-new-process) nothing 
is executed in the script after that point, it just stops. I put in a system 
'echo test  file.txt' command, to see if it is even moving past the part 
where it opens the browser, and it doesn't execute it. It just terminates. 

I am guessing that since stderr, stdin, stdout are all disabled for rubyw.exe, 
that is why I get nothing, just terminates...

Does it have something to do with the fact that ie-new-process puts the process 
id to stdout? Maybe that is what is crashing it when running under rubyw.exe?

If I put it back to use ruby.exe, instead of rubyw.exe, the code works 
perfectly... (But I have that ruby console window sitting there, which is a 
little bit of an annoyance, especially if you have several scripts running...)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] ie-new-process and rubyw.exe? bug?

2007-05-24 Thread Bret Pettichord
Norm wrote:
 Does it have something to do with the fact that ie-new-process puts the 
 process id to stdout? Maybe that is what is crashing it when running under 
 rubyw.exe?
   
I recently changed the code in trunk to stop printing the process id, so 
that might explain something...

I'm having a little bit of trouble following the thread and 
understanding exactly what is and isn't working for you. If you could 
summarize, that would help me.

Bret
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] ie-new-process and rubyw.exe? bug?

2007-05-24 Thread Norm
np Bret, the thread turned into (2) different issues, so it got a little hairy.

The 2nd problem that I was talking about, in respect to running scripts outside 
of the watir directory, is fixed. Problem solved.

The 1st problem, and the problem I started this thread for, is still on-going.

Here is the full source code that I am executing:

==
require 'rubygems'
require_gem 'watir'
require 'watir/contrib/ie-new-process' 


$ie = Watir::IE.new_process
$ie.logger.level = Logger::ERROR
$ie.goto(http://www.google.com;)
$ie.text_field(:name, q).set(TEXT)
==

When I have the default action for a .rb file (Tools--Folder Options--File 
Types) set to:

c:\ruby\bin\rubyw.exe %1 %*

OR, if I run the script from the cmd prompt using rubyw (rubyw.exe script.rb), 
as soon as the browser is opened the script terminates. It won't even execute 
the goto function and navigate to the proper url, or set the text_field.

This happens whether or not I have the logger line of code as well, so it 
isn't that.

This same code works 100% fine when I use ruby.exe instead of rubyw.exe.

I am using ruby 1.8.5, with watir watir-1[1].5.1.1166.gem.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Watir Development Gem 1.5.1.1192 Released

2007-05-24 Thread Bret Pettichord
A new gem is ready for download. This is the latest pull from Subversion 
trunk, tagged at 1.5.1.1192. This gem has a new install process, due to 
a new dependency on other gems.

  http://wiki.openqa.org/display/WTR/Development+Builds

After downloading the gem, execute the following commands in the same 
directory as the gem:

   gem install win32-process --include-dependencies
   gem install watir

Changes in this release include:

* Migrated IE.new_process from watir/contrib and improved its 
reliability. We now recommend IE.new_process over IE.new as a way to 
avoid numerous errors detailed in http://jira.openqa.org/browse/WTR-150.
* Added IE.start_process. This works like IE.start, but uses the 
new_process mechanism to start IE.
* Added IE.new_window and IE.start_window. This are synonyms for IE.new 
and IE.start.
* Added dependency on the win32-process gem.
* Rdoc updates from Jeff Fry
* Added IE.each, which iterates through the various IE windows currently 
open.
* Updated WindowHelper and watir/dialog to work with IE7


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] RDOC - Help determining what needs documentation

2007-05-24 Thread Jeff Fry
Hey y'all, I'm resending these in the hopes of getting info from folks 
who know what watir actually does better than I do. If you are up for 
updating the wiki chart, great...but if you just want to email me some 
corrections, that'd be totally fine too. I'll happily update the chart.


Jeff Fry wrote:
Here's my first stab at a centralized page to describe supported 
elements, 'how's for interacting with those elements, and a chart of 
which 'how's apply to which elements:

http://wiki.openqa.org/display/WTR/Methods+supported+by+Element

For the chart, I tried to follow the rdoc, but I didn't follow it too 
closely, knowing that the rdoc already has inaccuracies in it. I'm 
hoping that someone who knows what *actually* does and doesn't work 
will volunteer to correct the chart (or even just email me corrections 
to make myself).


I added a number of questions at the bottom of the page, but will 
repeat them here for convenience:
* Are there any missing element types, or element types that shouldn't 
be included? (What about the following methods: tableCell? file_field? 
ps? pre?)

* Any missing (or extraneous) attributes?
* Any inaccuracies? (I assume that currently there are many.

[snip] cut two questions that Zeljko already answered for me [/snip]

* Can someone add descriptions for :method and :action, above?
* Other suggestions?

I have made a number of other edits to the rdoc but am not ready to 
submit a second patch yet. I hope to post it by Wednesday.

Now I'll have them done by the end of the long weekend.


Cheers,
Jeff


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] CAN BE CLICK LINK ASSOCIATED WITH AN IMAGE

2007-05-24 Thread SHALINI GUPTA

Thanks !! it works


On 5/24/07, Bret Pettichord [EMAIL PROTECTED] wrote:


Željko Filipin wrote:
 On 5/24/07, *Bret Pettichord* [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:

 ie.link(:after, ie.image(:id, 'foo')).click


 Bret, this does not work for me. Am I doing something wrong?
My mistake. Try this instead.

ie.link(:after?, ie.image(:id, 'foo')).click



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general