Re: [Wtr-general] How do you access an image that doesn't have img in the HTML tag?

2006-10-05 Thread Paul Carvalho
Hello Eva,What output does the following command produce when executed at an IRB prompt?  ie.show_imagesOr if it's in a frame:  ie.frame(:name, 'framename').show_images
On 04/10/06, Eva [EMAIL PROTECTED] wrote:
Typically image have this tag...[snip] I know this isn't a typical image tag. I believe that is why I'm having these problems. Any suggestions to get this to work?
brbrThanks.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] How do you access an image that doesn't have img in the HTML tag?

2006-10-05 Thread Angrez Singh
Hi,

Its an image button try this:

ie.button(:id, grdCompCodes__ctl2_imgSelect).click

- Angrez
On 10/5/06, Eva [EMAIL PROTECTED] wrote:
Typically image have this tag... img id=Banner1_imgProductName key=LogoWhite.gif
 src="" alt= border=0 / brbrHere is the html code for the triangle image I'm trying to click on...input type=image name=grdCompCodes:_ctl2:imgSelect id=grdCompCodes__ctl2_imgSelect src="" alt= border=0 /
brbrI tried the following...$ie.image(:name, grdCompCodes:_ctl2:imgSelect).clickbrbrThe results in the command prompt are Unable to locate object, using name and grdCompCodes:_ctl2:imgSelect (Watir::Exception::UnknownObjectException)
brbrI also tried the following...$ie.image(:id, grdCompCodes__ctl2_imgSelect).clickbrbrThe results were the same, except the problem was with the id.brbr
I also tried using the index method, but it couldn't find this image. I don't know if this image has an index?brbrI know this isn't a typical image tag. I believe that is why I'm having these problems. Any suggestions to get this to work?
brbrThanks.-Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4672messageID=12899#12899___Wtr-general mailing listWtr-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] OT: odd memory behavior question

2006-10-05 Thread Bret Pettichord
On 10/4/06, Chris McMahon [EMAIL PROTECTED] wrote:
However, it seems that when I clear the array with ginormous_array = [], Ruby doesn't give back the memory it took loading it up in the first place. 
Anyone have a suggestion of how to force Ruby to give back the memory for an array that no longer contains any data? You need to run the garbage collector. It is something like this:
 GC.start You also need to make sure that you don't retain any references to any bits of the array. Assign them to nil, or better, ensure they are out of scope.Bret
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] JavasScript Menu .click not working

2006-10-05 Thread Michael Ehrich








Hi,



im not sure if my posts actually reach the mailinglist cuz i
did not seem to get any answers so far.

Im still messing with the problem described in that
post http://www.mail-archive.com/wtr-general%40rubyforge.org/msg05416.html

maybe someone can help me or maybe someone can tell me where
i can report that bug. Because for me it seems like

this is a bug. No error is reported but i still only get a
little blink and no click which is very weird cuz i tried a simple

version of that menu myself and it worked pretty well. So ist
maybe a frame bug or i dont know. Doesnt look like ist

right.



Best regards

Michael Ehrich






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

Re: [Wtr-general] Javascript Alert windows

2006-10-05 Thread Cain, Mark








The _javascript_ Alert, Confirm, Prompt,
Security, File Save, File Download, File Upload, error message, and login (I think
this is a complete list but there may be others) are all a special type of
modal popup dialog windowthere isnt a different one. In
order to handle these types of popups you have to start another thread independent
of your $ie thread OR you have to not block the process by using click_no_wait.

There are two ways (that actually both use
the WInClicker). The first one is listed below that works with the older
versions of Watir. The second (I have found after using them both) is
more reliable than the first but require you having a Watir version greater
than 1079 because of some fixes to click_no_wait (cant remember the
exact version). You can get them here: http://wiki.openqa.org/display/WTR/Development+Builds




First
method (works with Watir 1.4.x):

def jsAlert(button, waitTime = 3)
w = WinClicker.new
longName = $ie.dir.gsub(/ ,
\\ )
shortName = w.getShortFileName(longName)
c = start ruby
#{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} 
puts Starting #{c}
w.winsystem(c)
w=nil
end



Then, before the button you want to click
that generates the popup, add in:

jsAlert(OK, 3)

ie.button(:name,
woohoo).click # This
is the button you want to click that generates the popup



Second
Method (faster and more reliable):

require 'watir\contrib\enabled_popup'



Your code



$ie.button(Button Label Text).click_no_wait



# use click_no_wait to click the button
that invokes the JS Alert $ie.button.click_no_wait



hwnd =
ie.enabled_popup(5)
# get a handle if one exists

if (hwnd)
# yes there is a popup

 w =
WinClicker.new

 w.makeWindowActive(hwnd)

#
OK or whatever the name on the button is

 w.clickWindowsButton_hwnd(hwnd,
OK) 

end



NOTE: If you are using IE7 then the title
on the JS Alert box is different then IE6+ so you will need to alter you WinClicker.rb
file for either method.

\ruby\lib\ruby\site_ruby\1.8\watir\WinClicker.rb
Lines 113 and 144.

IE6 = Microsoft
Internet Explorer

IE7 = Windows
Internet Explorer



Hope this helps,







--Mark










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

Re: [Wtr-general] How do you access an image that doesn't have img in the HTML tag?

2006-10-05 Thread Dave Munns
Try ie.button( :src, \images\SelectRow1.gif ).click
You may to specify the full directory path 
(C:\whatever...\images\SelectRow1.gif)
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4672messageID=12948#12948
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] OT: odd memory behavior question

2006-10-05 Thread Chris McMahon

Anyone have a suggestion of how to force Ruby to give back the memory for an array that no longer contains any data? You need to run the garbage collector. It is something like this:

 GC.start You also need to make sure that you don't retain any references to any bits of the array. Assign them to nil, or better, ensure they are out of scope.This is good to know. However, I didn't have to resort to using it. Running the process overnight, reloading ginormous_array 5 times, it seems that Ruby is re-using a lot of this memory. My Ruby process is still holding on to a lot of memory, but not nearly as much as loading the whole set of data into a single array. 

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

Re: [Wtr-general] JavasScript Menu .click not working

2006-10-05 Thread Attebery, Bill








Sounds like you may be encountering the
same thing I found when trying to work with the google ajax tree  seems that
the click event is actually being handled at the window level and not the
browser level (or something along those lines)  so using onClick or
.click through water isnt the same.







http://www.mail-archive.com/wtr-general@rubyforge.org/msg04974.html





Hi,



im not sure if my posts actually reach the mailinglist cuz i
did not seem to get any answers so far.

Im still messing with the problem described in that
post http://www.mail-archive.com/wtr-general%40rubyforge.org/msg05416.html

maybe someone can help me or maybe someone can tell me where
i can report that bug. Because for me it seems like

this is a bug. No error is reported but i still only get a little
blink and no click which is very weird cuz i tried a simple

version of that menu myself and it worked pretty well. So
ist maybe a frame bug or i dont know. Doesnt look like ist

right.



Best regards

Michael Ehrich






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

Re: [Wtr-general] How do you access an image that doesn't have img in the HTML tag?

2006-10-05 Thread Eva
This worked. Thanks so much, Angrez. I was struggling with this for so long. I 
really appreciate everyone's help on this.

ie.button(:id, grdCompCodes__ctl2_imgSelect).click
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4672messageID=12963#12963
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] OT: odd memory behavior question

2006-10-05 Thread Bret Pettichord
This is good to know.  However, I didn't have to resort to using
it.  Running the process overnight, reloading ginormous_array 5
times, it seems that Ruby is re-using a lot of this memory.  My Ruby
process is still holding on to a lot of memory, but not nearly as
much as loading the whole set of data into a single array. 


Ruby will run the garbage collector automatically when it runs out of 
memory. You probably want to learn more about how Ruby allocates memory.

For example

 string  addendum

modifies an existing string, whereas

  string += addendum

creates a new one, thus using memory.

Little things like this starting becoming really important when you have 
large data sets.

Bret

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


Re: [Wtr-general] How do you access an image that doesn't have img in the HTML tag?

2006-10-05 Thread Paul Rogers
a reg exp is better here

ie.button( :src, /SelectRow1.gif/ ).click


- Original Message - 
From: Dave Munns [EMAIL PROTECTED]
To: wtr-general@rubyforge.org
Sent: Thursday, October 05, 2006 8:55 AM
Subject: Re: [Wtr-general] How do you access an image that doesn't have img 
in the HTML tag?


 Try ie.button( :src, \images\SelectRow1.gif ).click
 You may to specify the full directory path 
 (C:\whatever...\images\SelectRow1.gif)
 -
 Posted via Jive Forums
 http://forums.openqa.org/thread.jspa?threadID=4672messageID=12948#12948
 ___
 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] How do you access an image that doesn't have img in the HTML tag?

2006-10-05 Thread Richard Conroy
On 10/5/06, Eva [EMAIL PROTECTED] wrote:
 Typically image have this tag...
  img id=Banner1_imgProductName key=LogoWhite.gif 
 src=/images/LogoWhite.gif alt= border=0 / 
 brbr
 Here is the html code for the triangle image I'm trying to click on...
 input type=image name=grdCompCodes:_ctl2:imgSelect 
 id=grdCompCodes__ctl2_imgSelect src=/images/SelectRow1.gif alt= 
 border=0 /

ie.image(:src, /images/SelectRow1.gif)

Eva, I take it that this image alters when you click on it, or gets all
funky due to the javascript.

I had the same problem with javascript toggling something open and
closed (different graphics)

You could also get an array of all the images in the page and click
on it by index

ie.images[1].click #or equivalent
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general