[wtr-general] Re: Mac FireWatir PopUp

2009-09-29 Thread Angrez Singh
We need to figure out a way on how to handle download dialogs in Firewatir
to make in platform independent. As of now we are using AutoIT to do the
same in Firewatir on windows. I'll be working on it.

Thanks,
Angrez

On Mon, Sep 28, 2009 at 11:38 PM, Brad bradask...@gmail.com wrote:


 Surly I'm not the only person who has this problem :-)

 On Sep 25, 7:49 am, Brad bradask...@gmail.com wrote:
  Hi Angrez,
 
  What I'm seeing is the pop dialog, which is a download dialog is not
  clicked on i.e. it is not dismisses.
 
  If I understand the code correctly you say what you want to happen to
  the dialog first and then click on the link which popups the dialog
  and then your first action happens, correct?
 
  I different I see is in the example the JavaScript dialog box come
  down out of the browser and the popup handler works.  My dialog is
  free floating modal dialog.
 
  Any suggestions?
 
  Thanks.
 
  Brad
 
  On Sep 25, 1:24 am, Angrez Singh ang...@gmail.com wrote:
 
   What behaviour are you seeing? As per the pop up handling in Firewatir.
 Pop
   up will not show but whatever action you have written for OK or CANCEL
   button will happen.
 
   Thanks,
   Angrez
 
   On Thu, Sep 24, 2009 at 8:48 PM, Brad bradask...@gmail.com wrote:
 
I saw another thread about handling popups in FireWatir, but I didn't
see a resolution.
 
Please see the dialog box I'm trying to handle
   http://sites.google.com/site/watirattachments/
 
because if this is suppose to work...it isn't
 
@browser.startClicker(Cancel)
@browser.button(:caption, Agree and Download).click
 
I looked at the unittests and see that it works for the second image
on this page
   http://sites.google.com/site/watirattachments/
 
Thanks for any help.
 
Brad
 


--~--~-~--~~~---~--~~
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: Elements supported by Watir

2009-09-29 Thread Željko Filipin
On Mon, Sep 28, 2009 at 6:08 PM, Bret Pettichord bpettich...@gmail.com
wrote:
  def is_element_subclass? klass
  while klass = klass.superclass
  return true if klass == Watir::Element
  end
  end

  ObjectSpace.each_object(Class){|c| puts c if is_element_subclass?(c)}

I executed this code on Mac and Windows and got this error message:

NameError: uninitialized constant Watir::Element
from (irb):5:in `is_element_subclass?'
from (irb):9
from (irb):9:in `each_object'
from (irb):9

I tried with or without `require watir` as the first line.

What am I doing wrong?

Mac:
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0])
commonwatir (1.6.2)
firewatir (1.6.2)
safariwatir (0.3.3)

Windows:
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
commonwatir (1.6.2)
firewatir (1.6.2)
watir (1.6.2)

Željko

--~--~-~--~~~---~--~~
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] Right Click and Element Script

2009-09-29 Thread Pallavi Sharma
Hi All

I am trying to work on the script:

require 'watir'

module Watir
  class Element
def top_edge
  assert_exists
  assert_enabled
  ole_object.getBoundingClientRect.top.to_i
end

def top_edge_absolute
  top_edge + container.document.parentWindow.screenTop.to_i
end

def left_edge
  assert_exists
  assert_enabled
  ole_object.getBoundingClientRect.left.to_i
end

def left_edge_absolute
  left_edge + container.document.parentWindow.screenLeft.to_i
end

def right_click
  x = left_edge_absolute
  y = top_edge_absolute
  #puts x: #{x}, y: #{y}
  WindowsInput.move_mouse(x, y)
  WindowsInput.right_click
end
  end
end

module WindowsInput
  # Windows API functions
 SetCursorPos = Win32API.new('user32','SetCursorPos', 'II', 'I')
  SendInput = Win32API.new('user32','SendInput', 'IPI', 'I')

  # Windows API constants
  INPUT_MOUSE = 0
  MOUSEEVENTF_LEFTDOWN = 0x0002
  MOUSEEVENTF_LEFTUP = 0x0004
  MOUSEEVENTF_RIGHTDOWN = 0x0008
  MOUSEEVENTF_RIGHTUP = 0x0010

  module_function

  def send_input(inputs)
n = inputs.size
ptr = inputs.collect {|i| i.to_s}.join # flatten arrays into single
string
SendInput.call(n, ptr, inputs[0].size)
  end

  def create_mouse_input(mouse_flag)
mi = Array.new(7, 0)
mi[0] = INPUT_MOUSE
mi[4] = mouse_flag
mi.pack('LLL') # Pack array into a binary sequence usable to
SendInput
  end

  def move_mouse(x, y)
SetCursorPos.call(x, y)
  end

  def right_click
rightdown = create_mouse_input(MOUSEEVENTF_RIGHTDOWN)
rightup = create_mouse_input(MOUSEEVENTF_RIGHTUP)
send_input( [rightdown, rightup] )
  end
end

# Open google index page, and send a right click to the logo image
ie = Watir::IE.new
ie.goto('www.google.com')
image = ie.image(:index, 1)
image.right_click
# Then, bring up the properties menu (works with IE6, at least)
ie.send_keys({UP}{ENTER})


But it keeps giving me the error:

ruby TrryMe.rb
TrryMe.rb:37: uninitialized constant WindowsInput::Win32API (NameError)
Exit code: 1



What is that i am doing wrong??

I am using watir 1.6.2


Please help.

Thanks

Pallavi.

--~--~-~--~~~---~--~~
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: Right Click and Element Script

2009-09-29 Thread Raveendran P
Hi pallavi,

Pls add and try again

May be try this all possibilities

require 'rubygems'
require 'watir'
require 'pp'
require 'win32ole'
require win32ole_pp
require 'watir/WindowHelper'


Awaiting your reply...

Thanks

On Tue, Sep 29, 2009 at 3:17 PM, Pallavi Sharma write2pall...@gmail.comwrote:

 Hi All

 I am trying to work on the script:

 require 'watir'

 module Watir
   class Element
 def top_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.top.to_i
 end

 def top_edge_absolute
   top_edge + container.document.parentWindow.screenTop.to_i
 end

 def left_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.left.to_i
 end

 def left_edge_absolute
   left_edge + container.document.parentWindow.screenLeft.to_i
 end

 def right_click
   x = left_edge_absolute
   y = top_edge_absolute
   #puts x: #{x}, y: #{y}
   WindowsInput.move_mouse(x, y)
   WindowsInput.right_click
 end
   end
 end

 module WindowsInput
   # Windows API functions
  SetCursorPos = Win32API.new('user32','SetCursorPos', 'II', 'I')
   SendInput = Win32API.new('user32','SendInput', 'IPI', 'I')

   # Windows API constants
   INPUT_MOUSE = 0
   MOUSEEVENTF_LEFTDOWN = 0x0002
   MOUSEEVENTF_LEFTUP = 0x0004
   MOUSEEVENTF_RIGHTDOWN = 0x0008
   MOUSEEVENTF_RIGHTUP = 0x0010

   module_function

   def send_input(inputs)
 n = inputs.size
 ptr = inputs.collect {|i| i.to_s}.join # flatten arrays into single
 string
 SendInput.call(n, ptr, inputs[0].size)
   end

   def create_mouse_input(mouse_flag)
 mi = Array.new(7, 0)
 mi[0] = INPUT_MOUSE
 mi[4] = mouse_flag
 mi.pack('LLL') # Pack array into a binary sequence usable to
 SendInput
   end

   def move_mouse(x, y)
 SetCursorPos.call(x, y)
   end

   def right_click
 rightdown = create_mouse_input(MOUSEEVENTF_RIGHTDOWN)
 rightup = create_mouse_input(MOUSEEVENTF_RIGHTUP)
 send_input( [rightdown, rightup] )
   end
 end

 # Open google index page, and send a right click to the logo image
 ie = Watir::IE.new
 ie.goto('www.google.com')
 image = ie.image(:index, 1)
 image.right_click
 # Then, bring up the properties menu (works with IE6, at least)
 ie.send_keys({UP}{ENTER})


 But it keeps giving me the error:

 ruby TrryMe.rb
 TrryMe.rb:37: uninitialized constant WindowsInput::Win32API (NameError)
 Exit code: 1



 What is that i am doing wrong??

 I am using watir 1.6.2


 Please help.

 Thanks

 Pallavi.

 



-- 
Regards,
P.Raveendran

--~--~-~--~~~---~--~~
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] Cannot use the index in SafariWatir

2009-09-29 Thread yuping zhong

Dear All,

I use the watir to test in Safari. When I use the index method to the
button and radio,it doesn't work.

Here is the error:

irb(main):049:0 sf.button(:value=Enter,index=1).click
NameError: undefined local variable or method `index' for main:Object
from (irb):49
from :0

Any idea of this?
Many thanks!

-Zhong
--~--~-~--~~~---~--~~
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: Right Click and Element Script

2009-09-29 Thread Pallavi Sharma
Hey Ravee

Thanks a ton, maybe some one can update the stuff there at tha link, it will
surely help.

by the way: win32ole_pp throws an error so i removed it.

One more thing i will be using this on a div containg table, and its table
cell will it work??

Thanks

Pallavi

On Tue, Sep 29, 2009 at 3:58 PM, Raveendran P
raveend...@railsfactory.orgwrote:

 Hi pallavi,

 Pls add and try again

 May be try this all possibilities

 require 'rubygems'
 require 'watir'
 require 'pp'
 require 'win32ole'
 require win32ole_pp
 require 'watir/WindowHelper'


 Awaiting your reply...

 Thanks


 On Tue, Sep 29, 2009 at 3:17 PM, Pallavi Sharma 
 write2pall...@gmail.comwrote:

 Hi All

 I am trying to work on the script:

 require 'watir'

 module Watir
   class Element
 def top_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.top.to_i
 end

 def top_edge_absolute
   top_edge + container.document.parentWindow.screenTop.to_i
 end

 def left_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.left.to_i
 end

 def left_edge_absolute
   left_edge + container.document.parentWindow.screenLeft.to_i
 end

 def right_click
   x = left_edge_absolute
   y = top_edge_absolute
   #puts x: #{x}, y: #{y}
   WindowsInput.move_mouse(x, y)
   WindowsInput.right_click
 end
   end
 end

 module WindowsInput
   # Windows API functions
  SetCursorPos = Win32API.new('user32','SetCursorPos', 'II', 'I')
   SendInput = Win32API.new('user32','SendInput', 'IPI', 'I')

   # Windows API constants
   INPUT_MOUSE = 0
   MOUSEEVENTF_LEFTDOWN = 0x0002
   MOUSEEVENTF_LEFTUP = 0x0004
   MOUSEEVENTF_RIGHTDOWN = 0x0008
   MOUSEEVENTF_RIGHTUP = 0x0010

   module_function

   def send_input(inputs)
 n = inputs.size
 ptr = inputs.collect {|i| i.to_s}.join # flatten arrays into single
 string
 SendInput.call(n, ptr, inputs[0].size)
   end

   def create_mouse_input(mouse_flag)
 mi = Array.new(7, 0)
 mi[0] = INPUT_MOUSE
 mi[4] = mouse_flag
 mi.pack('LLL') # Pack array into a binary sequence usable to
 SendInput
   end

   def move_mouse(x, y)
 SetCursorPos.call(x, y)
   end

   def right_click
 rightdown = create_mouse_input(MOUSEEVENTF_RIGHTDOWN)
 rightup = create_mouse_input(MOUSEEVENTF_RIGHTUP)
 send_input( [rightdown, rightup] )
   end
 end

 # Open google index page, and send a right click to the logo image
 ie = Watir::IE.new
 ie.goto('www.google.com')
 image = ie.image(:index, 1)
 image.right_click
 # Then, bring up the properties menu (works with IE6, at least)
 ie.send_keys({UP}{ENTER})


 But it keeps giving me the error:

 ruby TrryMe.rb
 TrryMe.rb:37: uninitialized constant WindowsInput::Win32API (NameError)
 Exit code: 1



 What is that i am doing wrong??

 I am using watir 1.6.2


 Please help.

 Thanks

 Pallavi.





 --
 Regards,
 P.Raveendran

 


--~--~-~--~~~---~--~~
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: Right Click and Element Script

2009-09-29 Thread Raveendran P
Hi pallavi,

Yes. Def it will work..

If not then pls paste ur html code here.

Thanks
P.Raveendran

On Tue, Sep 29, 2009 at 4:10 PM, Pallavi Sharma write2pall...@gmail.comwrote:

 Hey Ravee

 Thanks a ton, maybe some one can update the stuff there at tha link, it
 will surely help.

 by the way: win32ole_pp throws an error so i removed it.

 One more thing i will be using this on a div containg table, and its table
 cell will it work??

 Thanks

 Pallavi


 On Tue, Sep 29, 2009 at 3:58 PM, Raveendran P raveend...@railsfactory.org
  wrote:

 Hi pallavi,

 Pls add and try again

 May be try this all possibilities

 require 'rubygems'
 require 'watir'
 require 'pp'
 require 'win32ole'
 require win32ole_pp
 require 'watir/WindowHelper'


 Awaiting your reply...

 Thanks


 On Tue, Sep 29, 2009 at 3:17 PM, Pallavi Sharma 
 write2pall...@gmail.comwrote:

 Hi All

 I am trying to work on the script:

 require 'watir'

 module Watir
   class Element
 def top_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.top.to_i
 end

 def top_edge_absolute
   top_edge + container.document.parentWindow.screenTop.to_i
 end

 def left_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.left.to_i
 end

 def left_edge_absolute
   left_edge + container.document.parentWindow.screenLeft.to_i
 end

 def right_click
   x = left_edge_absolute
   y = top_edge_absolute
   #puts x: #{x}, y: #{y}
   WindowsInput.move_mouse(x, y)
   WindowsInput.right_click
 end
   end
 end

 module WindowsInput
   # Windows API functions
  SetCursorPos = Win32API.new('user32','SetCursorPos', 'II', 'I')
   SendInput = Win32API.new('user32','SendInput', 'IPI', 'I')

   # Windows API constants
   INPUT_MOUSE = 0
   MOUSEEVENTF_LEFTDOWN = 0x0002
   MOUSEEVENTF_LEFTUP = 0x0004
   MOUSEEVENTF_RIGHTDOWN = 0x0008
   MOUSEEVENTF_RIGHTUP = 0x0010

   module_function

   def send_input(inputs)
 n = inputs.size
 ptr = inputs.collect {|i| i.to_s}.join # flatten arrays into single
 string
 SendInput.call(n, ptr, inputs[0].size)
   end

   def create_mouse_input(mouse_flag)
 mi = Array.new(7, 0)
 mi[0] = INPUT_MOUSE
 mi[4] = mouse_flag
 mi.pack('LLL') # Pack array into a binary sequence usable to
 SendInput
   end

   def move_mouse(x, y)
 SetCursorPos.call(x, y)
   end

   def right_click
 rightdown = create_mouse_input(MOUSEEVENTF_RIGHTDOWN)
 rightup = create_mouse_input(MOUSEEVENTF_RIGHTUP)
 send_input( [rightdown, rightup] )
   end
 end

 # Open google index page, and send a right click to the logo image
 ie = Watir::IE.new
 ie.goto('www.google.com')
 image = ie.image(:index, 1)
 image.right_click
 # Then, bring up the properties menu (works with IE6, at least)
 ie.send_keys({UP}{ENTER})


 But it keeps giving me the error:

 ruby TrryMe.rb
 TrryMe.rb:37: uninitialized constant WindowsInput::Win32API (NameError)
 Exit code: 1



 What is that i am doing wrong??

 I am using watir 1.6.2


 Please help.

 Thanks

 Pallavi.





 --
 Regards,
 P.Raveendran




 



-- 
Regards,
P.Raveendran
http://raveendran.wordpress.com

--~--~-~--~~~---~--~~
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] Cinfiguring Fitnesse with ruby slim

2009-09-29 Thread Rinku Garg

Hi Everybody,

I want to configure Rubyslim with fitnesse. Can anybody tell me the
steps how to do that. I simple small example will be really
appreciated.

Regards
Rinku Garg
--~--~-~--~~~---~--~~
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: Cinfiguring Fitnesse with ruby slim

2009-09-29 Thread Željko Filipin
On Tue, Sep 29, 2009 at 1:20 PM, Rinku Garg rinkugar...@gmail.com wrote:
 I want to configure Rubyslim with fitnesse.

You are probably at the wrong place. This is Watir group. Try posting this
to Rubyslim and/or fitnesse groups.

Željko
--
http://watirpodcast.com/

--~--~-~--~~~---~--~~
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: Right Click and Element Script

2009-09-29 Thread Raveendran P
Hi Pallavi,

May be the focus missing here. So please adjust the changes here and try it.
(its not a exact solution but it may be help some times)


 # Windows API constants
  INPUT_MOUSE = 0
  MOUSEEVENTF_LEFTDOWN = 0x0002
  MOUSEEVENTF_LEFTUP = 0x0004
  MOUSEEVENTF_RIGHTDOWN = 0x0008
  MOUSEEVENTF_RIGHTUP = 0x0010


This code is available under Watir module (which was you pasted in first
thread.)


Thanks.

On Tue, Sep 29, 2009 at 4:55 PM, Pallavi Sharma write2pall...@gmail.comwrote:

 Hey Ravee

 Its not working :(

 I have a scenario in which :

 1. A link opens a Div tag on which a image open another div tag which
 contains a table.
 2. Now, i have to click on a table cell to select my date
 3. For the same i am using this function.
 4. It open the calendar div but doesn't click on the table cell present
 inside the calendar div.

 The coordinates it returns for the cell are x=0,y=112 [doesn't work]

 The icon which opens the calendar, its coordinates are: x=503,y=499  [this
 one works]

 Is my page_container wrong or whats the issue?


 The screen shot is attached and i am trying to save the page but not able
 to. The code snippets are attached.

 Please help!!

 Thanks

 Pallavi


 On Tue, Sep 29, 2009 at 4:43 PM, Raveendran P jazzezr...@gmail.comwrote:

 Hi pallavi,

 Yes. Def it will work..

 If not then pls paste ur html code here.

 Thanks
 P.Raveendran


 On Tue, Sep 29, 2009 at 4:10 PM, Pallavi Sharma 
 write2pall...@gmail.comwrote:

 Hey Ravee

 Thanks a ton, maybe some one can update the stuff there at tha link, it
 will surely help.

 by the way: win32ole_pp throws an error so i removed it.

 One more thing i will be using this on a div containg table, and its
 table cell will it work??

 Thanks

 Pallavi


 On Tue, Sep 29, 2009 at 3:58 PM, Raveendran P 
 raveend...@railsfactory.org wrote:

 Hi pallavi,

 Pls add and try again

 May be try this all possibilities

 require 'rubygems'
 require 'watir'
 require 'pp'
 require 'win32ole'
 require win32ole_pp
 require 'watir/WindowHelper'


 Awaiting your reply...

 Thanks


 On Tue, Sep 29, 2009 at 3:17 PM, Pallavi Sharma 
 write2pall...@gmail.com wrote:

 Hi All

 I am trying to work on the script:

 require 'watir'

 module Watir
   class Element
 def top_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.top.to_i
 end

 def top_edge_absolute
   top_edge + container.document.parentWindow.screenTop.to_i
 end

 def left_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.left.to_i
 end

 def left_edge_absolute
   left_edge + container.document.parentWindow.screenLeft.to_i
 end

 def right_click
   x = left_edge_absolute
   y = top_edge_absolute
   #puts x: #{x}, y: #{y}
   WindowsInput.move_mouse(x, y)
   WindowsInput.right_click
 end
   end
 end

 module WindowsInput
   # Windows API functions
  SetCursorPos = Win32API.new('user32','SetCursorPos', 'II', 'I')
   SendInput = Win32API.new('user32','SendInput', 'IPI', 'I')

   # Windows API constants
   INPUT_MOUSE = 0
   MOUSEEVENTF_LEFTDOWN = 0x0002
   MOUSEEVENTF_LEFTUP = 0x0004
   MOUSEEVENTF_RIGHTDOWN = 0x0008
   MOUSEEVENTF_RIGHTUP = 0x0010

   module_function

   def send_input(inputs)
 n = inputs.size
 ptr = inputs.collect {|i| i.to_s}.join # flatten arrays into single
 string
 SendInput.call(n, ptr, inputs[0].size)
   end

   def create_mouse_input(mouse_flag)
 mi = Array.new(7, 0)
 mi[0] = INPUT_MOUSE
 mi[4] = mouse_flag
 mi.pack('LLL') # Pack array into a binary sequence usable to
 SendInput
   end

   def move_mouse(x, y)
 SetCursorPos.call(x, y)
   end

   def right_click
 rightdown = create_mouse_input(MOUSEEVENTF_RIGHTDOWN)
 rightup = create_mouse_input(MOUSEEVENTF_RIGHTUP)
 send_input( [rightdown, rightup] )
   end
 end

 # Open google index page, and send a right click to the logo image
 ie = Watir::IE.new
 ie.goto('www.google.com')
 image = ie.image(:index, 1)
 image.right_click
 # Then, bring up the properties menu (works with IE6, at least)
 ie.send_keys({UP}{ENTER})


 But it keeps giving me the error:

 ruby TrryMe.rb
 TrryMe.rb:37: uninitialized constant WindowsInput::Win32API (NameError)
 Exit code: 1



 What is that i am doing wrong??

 I am using watir 1.6.2


 Please help.

 Thanks

 Pallavi.





 --
 Regards,
 P.Raveendran








 --
 Regards,
 P.Raveendran
 http://raveendran.wordpress.com






 



-- 
Regards,
P.Raveendran
http://raveendran.wordpress.com

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

[wtr-general] Load Testing with WATIR

2009-09-29 Thread venky


Hi.
It's nice to come across to see your thoughts on WATIR (GOOGLE
GROUPS).

Actually I need some help at this piont, could you please

I am working on a java application testing manually till now but our
client
insisted us to test the load/performance of the application using
WATIR tool

THANKS,
VENKY

--~--~-~--~~~---~--~~
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] Load Testing with WATIR configuration settings - USERS/ Concurrency/ Rampup

2009-09-29 Thread venky

Hi,
Could anybody help me on how/ where to configure the users/ load/
other settings in WATIR for load/stress/performance testing.

Thanks,
venky
--~--~-~--~~~---~--~~
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: Load Testing with WATIR

2009-09-29 Thread Željko Filipin
On Tue, Sep 29, 2009 at 3:50 PM, venky greet.ven...@gmail.com wrote:
 test the load/performance of the application using
 WATIR tool

We have an example on the wiki:

http://wiki.openqa.org/display/WTR/Re-Usable+Load+Testing+Example

Željko
--
http://watirpodcast.com/

--~--~-~--~~~---~--~~
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: adding utf-8 character to text fields

2009-09-29 Thread Loft_Tester

Ok,
I got this to work.  Here is the code:

require 'win32ole'
require 'watir'

WIN32OLE.codepage = WIN32OLE::CP_UTF8 #UTF-8

###
$Browser = nil

ENV[watir_browser]=ie

$Browser = Watir::Browser.new
$Browser.goto www.google.com

$Browser.text_field(:name,'q').value = 考
$Browser.text_field(:name,'q').value = \xE8\x80\x83
###

On Sep 28, 4:11 pm, Loft_Tester aaronr...@gmail.com wrote:
 This link will give more information about the character including
 Scripting-language 
 stringhttp://www.isthisthingon.org/unicode/clipboard.php?add=25911

 On Sep 28, 4:01 pm, Loft_Tester aaronr...@gmail.com wrote:



  I am trying to enter a japanese(UTF8) character into one of the fields
  on our web page and I keep having ç ¾ posted instead of 攷.  I believe
  I have to let watir know that I am using UTF-8 but how.  I had the
  same problem going to the google.com home page.  I can copy and paste
  the character above and it works fine.  Here is the code I have been
  working with.

  --- 
  ---

  require 'watir'
  $KCODE='u'
  require 'win32ole'
  WIN32OLE.codepage = WIN32OLE::CP_ACP #UTF8

  ###
  $Browser = nil

  ENV[watir_browser]=ie

  $Browser = Watir::Browser.new
  $Browser.goto www.google.com
  $Browser.text_field(:name,'q').set(攷)

  #

  This should be simple enough to do but I am not sure how.  Thanks for
  your 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] Can you determine if a link will pop up a dialog?

2009-09-29 Thread Brad

Hey,

Running through a web site and clicking on links I have put in things
like this:

code snippet
when  .zip
link.click_no_wait
is_popup(@dialog_text_1) # text on dialog box

when  .pdf
link.click_no_wait
is_popup(@dialog_text_1) # text on dialog box
/code snippet

So I can handle the pop up and clear them.

However, sometimes a PDF opens in the browser window instead of a pop
up.

Is there a way to determine if a link will have a pop up or not?

Thanks.

Brad
--~--~-~--~~~---~--~~
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: Sai

2009-09-29 Thread Lisa Crispin
That is a good idea, where can we update the doc? Is it all in github also?
-- Lisa

On Mon, Sep 28, 2009 at 10:22 PM, Paul Rogers paul.rog...@shaw.ca wrote:

 You're a good writer, documentation is always in need of improvemnet.

 Paul

 On Mon, Sep 28, 2009 at 6:14 PM, Lisa Crispin lisa.cris...@gmail.comwrote:

 I'm in awe of anyone who contributes to open source tools. To me, the more
 recognition they get, the better. I am a guilty user of all these
 contributions.

 On Mon, Sep 28, 2009 at 6:22 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 On Mon, Sep 28, 2009 at 5:26 PM, Bret Pettichord bpettich...@gmail.com
 wrote:
  I think we could also recognize a community team. Maybe we add Sai to
 this group as
  well?

 I was planning to suggest more people for the core team after I see the
 response for Sai.

 Jari Bakken of Celerity (http://celerity.rubyforge.org/) and Dave Hoover
 of SafariWatir (http://safariwatir.rubyforge.org/).

 Looks like Jari belongs even to Watir core developers. I guess I did not
 monitor github close enough.

 Sai and Dave did not contribute any code to Watir, so they do not belong
 to core developers, but they created support for a browser that Watir did
 not support, and I think their effort should be recognized by adding them to
 the community team.

 Anyway, that is just my opinion. I this community does not think the
 same, I will accept it.

 Željko






 --
 Lisa Crispin
 Co-author with Janet Gregory, _Agile Testing: A Practical Guide for
 Testers and Agile Teams_ (Addison-Wesley 2009)
 http://lisacrispin.com





 



-- 
Lisa Crispin
Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers
and Agile Teams_ (Addison-Wesley 2009)
http://lisacrispin.com

--~--~-~--~~~---~--~~
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: Sai

2009-09-29 Thread Charley Baker
Hey Lisa,

  This lists where to find our documentation:
http://watir.com/documentation/  You're welcome to join in the fray. :)

- Charley

On Tue, Sep 29, 2009 at 10:51 AM, Lisa Crispin lisa.cris...@gmail.comwrote:

 That is a good idea, where can we update the doc? Is it all in github also?
 -- Lisa


 On Mon, Sep 28, 2009 at 10:22 PM, Paul Rogers paul.rog...@shaw.ca wrote:

 You're a good writer, documentation is always in need of improvemnet.

 Paul

 On Mon, Sep 28, 2009 at 6:14 PM, Lisa Crispin lisa.cris...@gmail.comwrote:

 I'm in awe of anyone who contributes to open source tools. To me, the
 more recognition they get, the better. I am a guilty user of all these
 contributions.

 On Mon, Sep 28, 2009 at 6:22 PM, Željko Filipin 
 zeljko.fili...@wa-research.ch wrote:

 On Mon, Sep 28, 2009 at 5:26 PM, Bret Pettichord bpettich...@gmail.com
 wrote:
  I think we could also recognize a community team. Maybe we add Sai to
 this group as
  well?

 I was planning to suggest more people for the core team after I see the
 response for Sai.

 Jari Bakken of Celerity (http://celerity.rubyforge.org/) and Dave
 Hoover of SafariWatir (http://safariwatir.rubyforge.org/).

 Looks like Jari belongs even to Watir core developers. I guess I did not
 monitor github close enough.

 Sai and Dave did not contribute any code to Watir, so they do not belong
 to core developers, but they created support for a browser that Watir did
 not support, and I think their effort should be recognized by adding them 
 to
 the community team.

 Anyway, that is just my opinion. I this community does not think the
 same, I will accept it.

 Željko






 --
 Lisa Crispin
 Co-author with Janet Gregory, _Agile Testing: A Practical Guide for
 Testers and Agile Teams_ (Addison-Wesley 2009)
 http://lisacrispin.com









 --
 Lisa Crispin
 Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers
 and Agile Teams_ (Addison-Wesley 2009)
 http://lisacrispin.com


 


--~--~-~--~~~---~--~~
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] Trying to get xpath to recognize long string with possible special characters... not working

2009-09-29 Thread bert

Thanks in advance!

I am trying to click on the following element using xpath by
referencing its unique onclick property:

a onclick=dijit.byId('queryDetail').href='DISPLAY-QUERY-SUMMARY.do?
taskId=6type=details'; dijit.byId('queryDetail').show(); return
false; href=details/a

I have tried several of the following and not sure what Im doing
wrong.  I keep getting a NoMethodError: undefined method `click' for
nil:NilClass.  As you can see the onclick property has various
apostrophes, ampersand, etc.  Not sure if this is the cause of my
troubles.

I have tried:

@browser.element_by_xpath(//a...@onclick='dijit.byId(\'queryDetail
\').href=\'DISPLAY-QUERY-SUMMARY.do?taskId=6\type=details\';
dijit.byId(\'queryDetail\').show(); return false;']).click

@browser.element_by_xpath(//a...@onclick='dijit.byId
('queryDetail').href='DISPLAY-QUERY-SUMMARY.do?
taskId=0type=sql'; dijit.byId('queryDetail').show
(); return false;']).click()pos;).show
(); return false;']).click()
--~--~-~--~~~---~--~~
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: Cannot use the index in SafariWatir

2009-09-29 Thread yuping zhong

Željko ,Good catch!
But I type sf.button(:value=Enter,:index=1).click,get the
following:

irb(main):011:0 sf.button(:value=Enter,:index=1).click
ArgumentError: wrong number of arguments (1 for 2)
from (irb):11:in `button'
from (irb):11
from :0

BWT, if I don't use the multiple attribute,get the same error:

irb(main):013:0 sf.button(:index=1).click
ArgumentError: wrong number of arguments (1 for 2)
from (irb):13:in `button'
from (irb):13
from :0




On Sep 29, 6:42 pm, Željko Filipin zeljko.fili...@wa-research.ch
wrote:
 On Tue, Sep 29, 2009 at 12:39 PM, yuping zhong littlezhong...@gmail.com
 wrote:

  irb(main):049:0 sf.button(:value=Enter,index=1).click

 You have forgot `:` in front of `index`:

 sf.button(:value=Enter,:index=1).click

 I am not sure that SafariWatir has multiple attribute support.

 Željko
 --http://watirpodcast.com/
--~--~-~--~~~---~--~~
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: Right Click and Element Script

2009-09-29 Thread Alan Baird
Pallavi -
I've tested the code at
http://wiki.openqa.org/display/WTR/Right+Click+an+Element a lot and I'm
pretty sure it works.  If you run the code that's in the box it should work.
 I would try that first.  You should not have to do any additional requires
to make it work (since win32api is required by watir).  See if you can get
this to work first.

If you are still having issues after that, let me know.

Alan

On Tue, Sep 29, 2009 at 7:08 AM, Pallavi Sharma write2pall...@gmail.comwrote:

 Hi Ravee

 How do i change it?? Any clue? I dont know what it stands for...??

 Thanks


 On Tue, Sep 29, 2009 at 5:11 PM, Raveendran P jazzezr...@gmail.comwrote:

 Hi Pallavi,

 May be the focus missing here. So please adjust the changes here and try
 it. (its not a exact solution but it may be help some times)


  # Windows API constants
   INPUT_MOUSE = 0
   MOUSEEVENTF_LEFTDOWN = 0x0002
   MOUSEEVENTF_LEFTUP = 0x0004
   MOUSEEVENTF_RIGHTDOWN = 0x0008
   MOUSEEVENTF_RIGHTUP = 0x0010


 This code is available under Watir module (which was you pasted in first
 thread.)


 Thanks.


 On Tue, Sep 29, 2009 at 4:55 PM, Pallavi Sharma 
 write2pall...@gmail.comwrote:

 Hey Ravee

 Its not working :(

 I have a scenario in which :

 1. A link opens a Div tag on which a image open another div tag which
 contains a table.
 2. Now, i have to click on a table cell to select my date
 3. For the same i am using this function.
 4. It open the calendar div but doesn't click on the table cell present
 inside the calendar div.

 The coordinates it returns for the cell are x=0,y=112 [doesn't work]

 The icon which opens the calendar, its coordinates are: x=503,y=499
 [this one works]

 Is my page_container wrong or whats the issue?


 The screen shot is attached and i am trying to save the page but not able
 to. The code snippets are attached.

 Please help!!

 Thanks

 Pallavi


 On Tue, Sep 29, 2009 at 4:43 PM, Raveendran P jazzezr...@gmail.comwrote:

 Hi pallavi,

 Yes. Def it will work..

 If not then pls paste ur html code here.

 Thanks
 P.Raveendran


 On Tue, Sep 29, 2009 at 4:10 PM, Pallavi Sharma 
 write2pall...@gmail.com wrote:

 Hey Ravee

 Thanks a ton, maybe some one can update the stuff there at tha link, it
 will surely help.

 by the way: win32ole_pp throws an error so i removed it.

 One more thing i will be using this on a div containg table, and its
 table cell will it work??

 Thanks

 Pallavi


 On Tue, Sep 29, 2009 at 3:58 PM, Raveendran P 
 raveend...@railsfactory.org wrote:

 Hi pallavi,

 Pls add and try again

 May be try this all possibilities

 require 'rubygems'
 require 'watir'
 require 'pp'
 require 'win32ole'
 require win32ole_pp
 require 'watir/WindowHelper'


 Awaiting your reply...

 Thanks


 On Tue, Sep 29, 2009 at 3:17 PM, Pallavi Sharma 
 write2pall...@gmail.com wrote:

 Hi All

 I am trying to work on the script:

 require 'watir'

 module Watir
   class Element
 def top_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.top.to_i
 end

 def top_edge_absolute
   top_edge + container.document.parentWindow.screenTop.to_i
 end

 def left_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.left.to_i
 end

 def left_edge_absolute
   left_edge + container.document.parentWindow.screenLeft.to_i
 end

 def right_click
   x = left_edge_absolute
   y = top_edge_absolute
   #puts x: #{x}, y: #{y}
   WindowsInput.move_mouse(x, y)
   WindowsInput.right_click
 end
   end
 end

 module WindowsInput
   # Windows API functions
  SetCursorPos = Win32API.new('user32','SetCursorPos', 'II', 'I')
   SendInput = Win32API.new('user32','SendInput', 'IPI', 'I')

   # Windows API constants
   INPUT_MOUSE = 0
   MOUSEEVENTF_LEFTDOWN = 0x0002
   MOUSEEVENTF_LEFTUP = 0x0004
   MOUSEEVENTF_RIGHTDOWN = 0x0008
   MOUSEEVENTF_RIGHTUP = 0x0010

   module_function

   def send_input(inputs)
 n = inputs.size
 ptr = inputs.collect {|i| i.to_s}.join # flatten arrays into
 single string
 SendInput.call(n, ptr, inputs[0].size)
   end

   def create_mouse_input(mouse_flag)
 mi = Array.new(7, 0)
 mi[0] = INPUT_MOUSE
 mi[4] = mouse_flag
 mi.pack('LLL') # Pack array into a binary sequence usable to
 SendInput
   end

   def move_mouse(x, y)
 SetCursorPos.call(x, y)
   end

   def right_click
 rightdown = create_mouse_input(MOUSEEVENTF_RIGHTDOWN)
 rightup = create_mouse_input(MOUSEEVENTF_RIGHTUP)
 send_input( [rightdown, rightup] )
   end
 end

 # Open google index page, and send a right click to the logo image
 ie = Watir::IE.new
 ie.goto('www.google.com')
 image = ie.image(:index, 1)
 image.right_click
 # Then, bring up the properties menu (works with IE6, at least)
 ie.send_keys({UP}{ENTER})


 But it keeps giving me the error:

 ruby TrryMe.rb
 TrryMe.rb:37: uninitialized constant WindowsInput::Win32API
 (NameError)
 Exit code: 1



 What is that 

[wtr-general] Re: Right Click and Element Script

2009-09-29 Thread Pallavi Sharma
Hi Alan

Thanks for the reply, i saw your post but until i made these

require 'rubygems'
require 'watir'
require 'pp'
require 'win32ole'
require win32ole_pp
require 'watir/WindowHelper'


require statements i was getting the Name Error, which was over after i
included them all. I don't know the reason. I am using watir 1.6.2 and ruby
1.86. What i will do today is let u know for which require statement it
fails.


Also, my query is i am not able to click on a Div tag calendar table which
is openend by another div tag which was openend by link.

Is it something to do with the Page_container ??? Where am i going wrong?
Any help..


Thanks

Pallavi.

On Wed, Sep 30, 2009 at 8:28 AM, Alan Baird aba...@bairdsnet.net wrote:

 Pallavi -
 I've tested the code at
 http://wiki.openqa.org/display/WTR/Right+Click+an+Element a lot and I'm
 pretty sure it works.  If you run the code that's in the box it should work.
  I would try that first.  You should not have to do any additional requires
 to make it work (since win32api is required by watir).  See if you can get
 this to work first.

 If you are still having issues after that, let me know.

 Alan


 On Tue, Sep 29, 2009 at 7:08 AM, Pallavi Sharma 
 write2pall...@gmail.comwrote:

 Hi Ravee

 How do i change it?? Any clue? I dont know what it stands for...??

 Thanks


 On Tue, Sep 29, 2009 at 5:11 PM, Raveendran P jazzezr...@gmail.comwrote:

 Hi Pallavi,

 May be the focus missing here. So please adjust the changes here and try
 it. (its not a exact solution but it may be help some times)


  # Windows API constants
   INPUT_MOUSE = 0
   MOUSEEVENTF_LEFTDOWN = 0x0002
   MOUSEEVENTF_LEFTUP = 0x0004
   MOUSEEVENTF_RIGHTDOWN = 0x0008
   MOUSEEVENTF_RIGHTUP = 0x0010


 This code is available under Watir module (which was you pasted in first
 thread.)


 Thanks.


 On Tue, Sep 29, 2009 at 4:55 PM, Pallavi Sharma write2pall...@gmail.com
  wrote:

 Hey Ravee

 Its not working :(

 I have a scenario in which :

 1. A link opens a Div tag on which a image open another div tag which
 contains a table.
 2. Now, i have to click on a table cell to select my date
 3. For the same i am using this function.
 4. It open the calendar div but doesn't click on the table cell present
 inside the calendar div.

 The coordinates it returns for the cell are x=0,y=112 [doesn't work]

 The icon which opens the calendar, its coordinates are: x=503,y=499
 [this one works]

 Is my page_container wrong or whats the issue?


 The screen shot is attached and i am trying to save the page but not
 able to. The code snippets are attached.

 Please help!!

 Thanks

 Pallavi


 On Tue, Sep 29, 2009 at 4:43 PM, Raveendran P jazzezr...@gmail.comwrote:

 Hi pallavi,

 Yes. Def it will work..

 If not then pls paste ur html code here.

 Thanks
 P.Raveendran


 On Tue, Sep 29, 2009 at 4:10 PM, Pallavi Sharma 
 write2pall...@gmail.com wrote:

 Hey Ravee

 Thanks a ton, maybe some one can update the stuff there at tha link,
 it will surely help.

 by the way: win32ole_pp throws an error so i removed it.

 One more thing i will be using this on a div containg table, and its
 table cell will it work??

 Thanks

 Pallavi


 On Tue, Sep 29, 2009 at 3:58 PM, Raveendran P 
 raveend...@railsfactory.org wrote:

 Hi pallavi,

 Pls add and try again

 May be try this all possibilities

 require 'rubygems'
 require 'watir'
 require 'pp'
 require 'win32ole'
 require win32ole_pp
 require 'watir/WindowHelper'


 Awaiting your reply...

 Thanks


 On Tue, Sep 29, 2009 at 3:17 PM, Pallavi Sharma 
 write2pall...@gmail.com wrote:

 Hi All

 I am trying to work on the script:

 require 'watir'

 module Watir
   class Element
 def top_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.top.to_i
 end

 def top_edge_absolute
   top_edge + container.document.parentWindow.screenTop.to_i
 end

 def left_edge
   assert_exists
   assert_enabled
   ole_object.getBoundingClientRect.left.to_i
 end

 def left_edge_absolute
   left_edge + container.document.parentWindow.screenLeft.to_i
 end

 def right_click
   x = left_edge_absolute
   y = top_edge_absolute
   #puts x: #{x}, y: #{y}
   WindowsInput.move_mouse(x, y)
   WindowsInput.right_click
 end
   end
 end

 module WindowsInput
   # Windows API functions
  SetCursorPos = Win32API.new('user32','SetCursorPos', 'II', 'I')
   SendInput = Win32API.new('user32','SendInput', 'IPI', 'I')

   # Windows API constants
   INPUT_MOUSE = 0
   MOUSEEVENTF_LEFTDOWN = 0x0002
   MOUSEEVENTF_LEFTUP = 0x0004
   MOUSEEVENTF_RIGHTDOWN = 0x0008
   MOUSEEVENTF_RIGHTUP = 0x0010

   module_function

   def send_input(inputs)
 n = inputs.size
 ptr = inputs.collect {|i| i.to_s}.join # flatten arrays into
 single string
 SendInput.call(n, ptr, inputs[0].size)
   end

   def create_mouse_input(mouse_flag)
 mi = Array.new(7, 0)
 mi[0] = INPUT_MOUSE
 mi[4] = mouse_flag
 

[wtr-general] Re: Load Testing with WATIR configuration settings - USERS/ Concurrency/ Rampup

2009-09-29 Thread Raveendran P
Hi,

I hope you will get the sample code from here --
http://wiki.openqa.org/display/WTR/Re-Usable+Load+Testing+Example

Do you need to run this sample code in your local machine ? it means do u
need help to install the dependencies ?

Thanks

On Tue, Sep 29, 2009 at 7:23 PM, venky greet.ven...@gmail.com wrote:


 Hi,
 Could anybody help me on how/ where to configure the users/ load/
 other settings in WATIR for load/stress/performance testing.

 Thanks,
 venky
 



-- 
Regards,
P.Raveendran
http://raveendran.wordpress.com

--~--~-~--~~~---~--~~
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: Issue with a Calendar in a Div /Table Object

2009-09-29 Thread srikanth gudikadi
Hi pallavi,

This is srikanth from ACTi, pune,

try this one to click on calendar event date.

browser.div(:class, calendar).cell(:text,26).fire_event(ondblclick)

and also try the below to fetching data.

 days = browser.table(:class, paramlist admintable).row(:text, Display
Events the of the next ? days(modes 2 or 3 only)).cell(:class,
paramlist_value).text_field(:id, paramsmodlatest_Days).value

 daysno = days.to_s.to_i

  putsSuper can manage calendar config = #{daysno}


thnx
Srik

On Tue, Sep 29, 2009 at 12:17 PM, Pallavi Sharma write2pall...@gmail.comwrote:

 Hi

 I have a problem and need some help for the same.

 I have a scenario in which a div tag contains a table and in which a
 calendar appears. Attached is the screen shot for the same.

 Now when we click normally on any date of the Calendar, the date gets
 highlighted but when i am trying to do the same using the watir script, it
 doesn't work. I dont understand the reason for the same.


 Can anyone here please help? Is it a third party control? Am i doing
 something wrong here.

 I can fetch the innerhtml , the text of cell but just cannot click on it.
 The script executes without any results?

 What to do??? Asked the developers, there is no event lurking behind.


 Thanks

 Pallavi.

 


--~--~-~--~~~---~--~~
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: Not able to click on a TD through Watir, though manually it is possible

2009-09-29 Thread srikanth gudikadi
Hi Isabel,

try this one to click on calendar to select date.

browser.div(:class, calendar).cell(:text,26).fire_event(ondblclick)

thnx
srik


On Fri, Sep 25, 2009 at 12:45 PM, Isabel joybe...@gmail.com wrote:


 I have a calendar using which I can set the date in the given text
 area. For
 this I need to click on a calendar icon and choose dates(by clicking
 on them) from the calendar that pops up. When I click on close on the
 calendar, the selected dates get set in the text area. now the problem
 is that .click apparently has no effect on the date which is a table
 cell and there seems to be no known JavaScript event that has been
 applied on it.

 the code for the calendar is as below:-
 TABLE cellSpacing=0 cellPadding=0 unselectable=trueTHEAD
 unselectable=trueTR unselectable=trueTD class=title
 unselectable=true navtype=400 ttip=About the calendar /TDTD
 class=title style=CURSOR: move colSpan=5 unselectable=true
 navtype=300 ttip=Drag to moveJanuary, 2011/TDTD class=title
 unselectable=true navtype=200 ttip=Closeclose/TD/TRTR
 unselectable=true/TR/THEADTHEAD unselectable=trueTR
 class=daynames unselectable=trueTD class=name day  weekend
 unselectable=truenbsp;nbsp; S/TDTD class= day name
 unselectable=true navtype=100 ttip=Display Monday first
 fdow=1nbsp;nbsp; M/TDTD class=name day  unselectable=true
 navtype=100 ttip=Display Tuesday first fdow=2nbsp;nbsp; T/
 TDTD class=name day  unselectable=true navtype=100
 ttip=Display Wednesday first fdow=3nbsp;nbsp; W/TDTD class=
 day name unselectable=true navtype=100 ttip=Display Thursday
 first fdow=4nbsp;nbsp; T/TDTD class=name day 
 unselectable=true navtype=100 ttip=Display Friday first
 fdow=5nbsp;nbsp; F/TDTD class=name day  weekend
 unselectable=true navtype=100 ttip=Display Saturday first
 fdow=6nbsp;nbsp; S/TD/TR/THEADTBODY
 unselectable=trueTR class=daysrow unselectable=trueTD class=
 day disabled unselectable=true otherMonth=truePnbsp;/P/
 TDTD class= day disabled unselectable=true
 otherMonth=truePnbsp;/P/TDTD class= day disabled
 unselectable=true otherMonth=truePnbsp;/P/TDTD class=
 day disabled unselectable=true otherMonth=truePnbsp;/P/
 TDTD class= day disabled unselectable=true
 otherMonth=truePnbsp;/P/TDTD class= day disabled
 unselectable=true otherMonth=truePnbsp;/P/TDTD
 class=weekend false day  unselectable=true ttip=_
 otherMonth=false1/TD/TRTR class=daysrow
 unselectable=trueTD class= day false weekend unselectable=true
 ttip=_ otherMonth=false2/TDTD class= day false
 unselectable=true ttip=_ otherMonth=false3/TDTD class= day
 false unselectable=true ttip=_ otherMonth=false4/TDTD
 class= day false unselectable=true ttip=_ otherMonth=false5/
 TDTD class= day false unselectable=true ttip=_
 otherMonth=false6/TDTD class= day false unselectable=true
 ttip=_ otherMonth=false7/TDTD class=weekend false day 
 unselectable=true ttip=_ otherMonth=false8/TD/TRTR
 class=daysrow unselectable=trueTD class= day false weekend
 unselectable=true ttip=_ otherMonth=false9/TDTD class= day
 false unselectable=true ttip=_ otherMonth=false10/TDTD
 class= day false unselectable=true ttip=_
 otherMonth=false11/
 TDTD class=false day  selected unselectable=true ttip=_
 otherMonth=false12/TDTD class=false day  unselectable=true
 ttip=_ otherMonth=false13/TDTD class=selected  day false
 unselectable=true ttip=_ otherMonth=false14/TDTD class= day
 false weekend unselectable=true ttip=_ otherMonth=false15/
 TD/TRTR class=daysrow unselectable=trueTD class= day false
 weekend unselectable=true ttip=_ otherMonth=false16/TDTD
 class= day false unselectable=true ttip=_
 otherMonth=false17/
 TDTD class= day false unselectable=true ttip=_
 otherMonth=false18/TDTD class= day false unselectable=true
 ttip=_ otherMonth=false19/TDTD class= day false
 unselectable=true ttip=_ otherMonth=false20/TDTD class= day
 false unselectable=true ttip=_ otherMonth=false21/TDTD
 class= day false weekend unselectable=true ttip=_
 otherMonth=false22/TD/TRTR class=daysrow
 unselectable=trueTD class= day false weekend unselectable=true
 ttip=_ otherMonth=false23/TDTD class= day false
 unselectable=true ttip=_ otherMonth=false24/TDTD class= day
 false unselectable=true ttip=_ otherMonth=false25/TDTD
 class= day false unselectable=true ttip=_
 otherMonth=false26/
 TDTD class= day false unselectable=true ttip=_
 otherMonth=false27/TDTD class= day false unselectable=true
 ttip=_ otherMonth=false28/TDTD class= day false weekend
 unselectable=true ttip=_ otherMonth=false29/TD/TRTR
 class=daysrow unselectable=trueTD class= day false weekend
 unselectable=true ttip=_ otherMonth=false30/TDTD class= day
 false unselectable=true ttip=_ otherMonth=false31/TDTD
 class= day disabled unselectable=true
 otherMonth=truePnbsp;/
 P/TDTD class= day disabled unselectable=true
 otherMonth=truePnbsp;/P/TDTD class= day disabled
 unselectable=true otherMonth=truePnbsp;/P/TDTD class=
 day disabled unselectable=true otherMonth=truePnbsp;/P/
 TDTD class= day disabled unselectable=true