Re: [Wtr-general] How to capture mail box icon

2007-06-11 Thread Željko Filipin

Hi Sapna,

This is how you can find out if mail box is open or closed. Let me know if
you do not know how to use this code.

irb ie.image(:index, 1).src =~ /mailclosed/
= 46

irb ie.image(:index, 1).src =~ /mailopen/
= nil

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

[Wtr-general] Need to fetch the ID

2007-06-11 Thread sapna
Hi,

I had posted this question earlier but did not get any information. So wanted 
to put the question again. Need help on this. Below is the HTML code. 

1 I want to check whether the mail is read or unread depending on the mail 
icon(first line of HTML)
2 Want to fetch the id generated (id=1303) depending on which I will click on 
the message link and that would take me to read message window.

img src=/AppsUIWeb/Themes/TopTabMenu/Images/mailopen.gifnbsp;6/8/2007
/tdtd
a 
href=/AppsUIWeb/SelfService/MessageDetail.aspx?id=1303messageToUser=TrueRE: 
Check Copy Request/a
/tdtd

Thanks in advance.

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


Re: [Wtr-general] How to capture mail box icon

2007-06-11 Thread sapna
Can u guid me how to use this code. I need to check if it is opened/closed and 
then open the closed mail.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Need to fetch the ID

2007-06-11 Thread Željko Filipin

On 6/11/07, sapna [EMAIL PROTECTED] wrote:


a
href=/AppsUIWeb/SelfService/MessageDetail.aspx?id=1303messageToUser=TrueRE:
Check Copy Request/a



Sapna,

To find id of that link you have to know some other attribute of that link.
I will assume that you know text RE: Check Copy Request

This is how you can get href attribute of that link.

irb ie.link(:text, RE: Check Copy Request).href
=
file:///C:/AppsUIWeb/SelfService/MessageDetail.aspx?id=1303messageToUser=True

This will extract 1303.

irb m = /id=(1303)/.match(ie.link(:text, RE: Check Copy Request).href)
= #MatchData:0x2d147b8

irb m[1]
= 1303

For more information see class MatchData (
http://phrogz.net/ProgrammingRuby/ref_c_matchdata.html)

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

Re: [Wtr-general] mouse right click?

2007-06-11 Thread Paul Rogers

the code in that page uses the javascript event object, which we've had 
problems with in watir.

I think you will be able to make this work by:

simulate right click
see if the menuitem div is visible
click it based on its text

something like this may be what you need

ie.link(:index,1).fireEvent(onContextMenu)
if ie.div(:text , Message Formur).style.visibility != hidden
ie.div(:text , message forum).click
end



- Original Message -
From: mihai [EMAIL PROTECTED]
Date: Monday, June 11, 2007 4:11 am
Subject: Re: [Wtr-general] mouse right click?

 with java script it works; but i have this problem, this is the 
 site : http://www.dynamicdrive.com/dynamicindex1/contextmenu.htm
 right click to select all and it appers a java menu; how do i 
 click, for example, on Message Forum in that menu?
 ___
 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


[Wtr-general] WATiR contract work in San Francisco

2007-06-11 Thread Bob
Experienced test engineer needed to work on Customer Facing Ecommerce
applications.  Requires significant commercial automation work using the
WATiR framework.  Immediate, long term contract situation.  Very solid team,
positive environment.
Calls or email are good.  Bob Lepesh, JD Strategies.
650-941-2900 [EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, June 11, 2007 2:30 AM
To: wtr-general@rubyforge.org
Subject: Wtr-general Digest, Vol 43, Issue 13

Send Wtr-general mailing list submissions to
wtr-general@rubyforge.org

To subscribe or unsubscribe via the World Wide Web, visit
http://rubyforge.org/mailman/listinfo/wtr-general
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]

You can reach the person managing the list at
[EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than Re: Contents of Wtr-general digest...


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


Re: [Wtr-general] Concurrent tests, different regions...

2007-06-11 Thread Bret Pettichord
eisdrache wrote:
 I understand what you are saying about the global variables, but in this case 
 they are a necessary evil as I am using the following code in order to handle 
 javascript pop-ups:

 def startClicker( button , waitTime= 9, user_input=nil )
  hwnd = $ie.enabled_popup(waitTime)  
  if (hwnd) 
   w = WinClicker.new
   if ( user_input ) 
w.setTextValueForFileNameField( hwnd, #{user_input} )
   end
   sleep 3 
   w.clickWindowsButton_hwnd( hwnd, #{button} )
   w=nil
  end
 end
Using this code with multiple threads will eventually fail 
unpredictably. You need to pass in the ie object as a parameter to avoid 
this.

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


Re: [Wtr-general] Scheduler

2007-06-11 Thread Jet Liu
Adding auto=true to the end of the URL does the trick.

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


[Wtr-general] Handling Popup

2007-06-11 Thread TT Blue

I'm new to Watir as well as Ruby, and I need help handling a pop-up dialog.

I've searched both the mailing list as well as the trying all that I've
found, but I couldn't get it to click on the OK pop-up button.
==
require 'watir'
require 'watir\enabled_popup'
#require 'watir/WinClicker'
  def startClicker( button , waitTime= 9, user_input=nil )
 # get a handle if one exists
 hwnd = $ie.enabled_popup(waitTime)
 if (hwnd)  # yes there is a popup
   w = WinClicker.new
   if ( user_input )
 w.setTextValueForFileNameField( hwnd, #{user_input} )
   end
   # I put this in to see the text being input it is not necessary to
work
   sleep 3
   # OK or whatever the name on the button is
   w.clickWindowsButton_hwnd( hwnd, #{button} )
   #
   # this is just cleanup
   w=nil
 end
   end

 switch_role.role.select(my role)
 startClicker( OK, 3, )
==
when I tried code block above, I get this error message:
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- watir\contrib\enabled_popup
(LoadError)
   from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
   from CMSlogin.rb:2

when I try this code block:

require 'watir/WinClicker'
def sstartClicker( 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

switch_role.role.select(my role)
 startClicker( OK, 3)

This just waits forever and does not click on the OK button.

==

Can someone please help?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Handling Popup

2007-06-11 Thread Hayato Iriumi
I just went through exactly the same issue.
Try to use click_no_wait and see what happens.

On 6/11/07, TT Blue [EMAIL PROTECTED] wrote:
 I'm new to Watir as well as Ruby, and I need help handling a pop-up dialog.

 I've searched both the mailing list as well as the trying all that I've
 found, but I couldn't get it to click on the OK pop-up button.
 ==
 require 'watir'
 require 'watir\enabled_popup'
  #require 'watir/WinClicker'
def startClicker( button , waitTime= 9, user_input=nil )
   # get a handle if one exists
   hwnd = $ie.enabled_popup(waitTime)
   if (hwnd)  # yes there is a popup
 w = WinClicker.new
 if ( user_input )
   w.setTextValueForFileNameField ( hwnd, #{user_input} )
 end
 # I put this in to see the text being input it is not necessary to
 work
 sleep 3
 # OK or whatever the name on the button is
 w.clickWindowsButton_hwnd( hwnd, #{button} )
 #
 # this is just cleanup
 w=nil
   end
 end

   switch_role.role.select(my role)
   startClicker( OK, 3, )
 ==
 when I tried code block above, I get this error message:
 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
 `gem_original_require': no such file to load -- watir\contrib\enabled_popup
 (LoadError)
 from
 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
 `require'
 from CMSlogin.rb:2

 when I try this code block:

 require 'watir/WinClicker'
 def sstartClicker( 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

 switch_role.role.select(my role)
   startClicker( OK, 3)

 This just waits forever and does not click on the OK button.

 ==

 Can someone please help?




 ___
 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] Need to fetch the ID

2007-06-11 Thread sapna
Hi Zeljko,

I have a quesion on the code you sent me. Kindly find the question below the 
code.

This will extract 1303.

irb m = /id=(1303)/.match(ie.link(:text, RE: Check Copy Request).href)
= #MatchData:0x2d147b8

Q: Here I mention the id but I want to fetch automatically because the id keep 
changing for every message replied. Hope my explaination is fine.

irb m[1]
= 1303
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Handling Popup

2007-06-11 Thread TT Blue

Tried that too, didn't work.

It's somewhat interesting because with QuickTest Pro, it identified that
dialog as winDialog and I'd thought the winClicker solution would work...
but it didn't.

On 6/11/07, Hayato Iriumi [EMAIL PROTECTED] wrote:


I just went through exactly the same issue.
Try to use click_no_wait and see what happens.

On 6/11/07, TT Blue [EMAIL PROTECTED] wrote:
 I'm new to Watir as well as Ruby, and I need help handling a pop-up
dialog.

 I've searched both the mailing list as well as the trying all that I've
 found, but I couldn't get it to click on the OK pop-up button.
 ==
 require 'watir'
 require 'watir\enabled_popup'
  #require 'watir/WinClicker'
def startClicker( button , waitTime= 9, user_input=nil )
   # get a handle if one exists
   hwnd = $ie.enabled_popup(waitTime)
   if (hwnd)  # yes there is a popup
 w = WinClicker.new
 if ( user_input )
   w.setTextValueForFileNameField ( hwnd, #{user_input} )
 end
 # I put this in to see the text being input it is not necessary
to
 work
 sleep 3
 # OK or whatever the name on the button is
 w.clickWindowsButton_hwnd( hwnd, #{button} )
 #
 # this is just cleanup
 w=nil
   end
 end

   switch_role.role.select(my role)
   startClicker( OK, 3, )
 ==
 when I tried code block above, I get this error message:
 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
 `gem_original_require': no such file to load --
watir\contrib\enabled_popup
 (LoadError)
 from
 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
 `require'
 from CMSlogin.rb:2

 when I try this code block:

 require 'watir/WinClicker'
 def sstartClicker( 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

 switch_role.role.select(my role)
   startClicker( OK, 3)

 This just waits forever and does not click on the OK button.

 ==

 Can someone please help?




 ___
 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

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