[wtr-general] Re: button.Click_No_Wait only highlights the button, does not click

2008-12-12 Thread HAHAHA

I have tried, using this code:

require 'watir'

browser = Watir::IE.new
browser.goto('http://www.google.com')
browser2 = Watir::IE.attach(:title, /Google/)
browser2.text_field(:name, 'q').set('Watir')
browser2.button(:name, 'btnG').click_no_wait

The click_no_wait still cannot run. Is the code right?

On Dec 12, 9:58 am, larryni...@gmail.com larryni...@gmail.com
wrote:
 Pramod, could you show us an example of your code?

 On Dec 11, 11:01 pm, pramod D petkar.pra...@gmail.com wrote:



  Hi Michael,

  Initially i also faced same problem when i use Click_no_wait control was
  going but never clicked it, To come around this initially i opened the IE
  (IE7)with blank page and then, i will attach the browser at the start of the
  script and continue to execute my script as usual and worked correctly. For
  time being you can fallow this turn around method.

  Thanks,
  Pramod
  On Fri, Dec 12, 2008 at 1:46 AM, Michael Hwee michael_h...@yahoo.comwrote:

   That is disappointing.
   I believe that is something like OS and/or configuration issues, rather
   than watir itself.

   Michael

   - Original Message 
   From: larryni...@gmail.com larryni...@gmail.com
   To: Watir General watir-general@googlegroups.com
   Sent: Thursday, December 11, 2008 12:00:00 PM
   Subject: [wtr-general] Re: button.Click_No_Wait only highlights the 
   button,
   does not click

   Sorry, Michael, your code doesn't work either.  It opens the page,
   highlights the button yellow, and then just sits there.  No popup is
   ever launched because it doesn't actually click the button.  Watir
   doesn't report any errors, but it never completes, either.  If I
   change click_no_wait to click!, it does launch the popup, but the
   handle_nextpopup command never executes - it's been sitting here for
   90-120 seconds with the popup open not doing anything.  So, again, to
   summarize: click_no_wait is incapable of firing any events, but click!
   makes the script hang.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: button.Click_No_Wait only highlights the button, does not click

2008-12-12 Thread Darin Duphorn

Relax

-Original Message-
From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On 
Behalf Of HAHAHA
Sent: Friday, December 12, 2008 9:14 AM
To: Watir General
Subject: [wtr-general] Re: button.Click_No_Wait only highlights the button, 
does not click


Why I cannot reply? Just try.

On Nov 28, 4:51 am, patrick patrick.thoma...@gmail.com wrote:
 hi,

 i am using the foll versions:

 win xp sp2
 ruby - 1.8.6
 watir - 1.6.2
 ie - 7.0

 my code is as follows:

 irb
 require watir
 browser = Watir::IE.start('http://www.google.com')
 browser.text_field(:name, 'q').set('Watir')
 browser.button(:name, 'btnG').click_no_wait

 however, the Google Search button is only highlighted. the button is
 not clicked and the subsequent page is not loaded. I know i can use
 click in this case, however the Click_no_wait is not working in any
 code on my pc. pls help.

 patrick.



--~--~-~--~~~---~--~~
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: Need to access the first LI element within an UL element

2008-12-12 Thread Bret Pettichord

/Signed in as (.*)/.match(browser.ul(:id, 'ulInfoLinks').li(:index, 
1).text)[1]

Natasha wrote:
 Hi All,

 I want to access the value of the LI element, which is within an UL
 element.

 Following is the HTML structure:

 UL class=inline id=ulInfoLinks
   LI
  Signed in as STRONG username /STRONG
   /LI
  LI  /LI
 /UL

 Basically I want to retrieve the name of the user that is logged in.

 Thanks,
 Natasha


 
   


--~--~-~--~~~---~--~~
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: click image for given DIV ID

2008-12-12 Thread Shiv

Bret

Since we have customiztion on the 1.4 watir code, we not able to
upgrade now. is there any tweak?

Thanks
Shiv
On Dec 12, 7:20 am, Bret Pettichord b...@pettichord.com wrote:
 This is a bug in Watir 1.4. It is fixed in Watir 1.5 and Watir 1.6. Time
 to upgrade.

 Bret



 Shiv wrote:
  Hi,

   I want to click image for knownDIVID. Let say, I want to click
  image ofDIVIDf4

  My code is this and it doesn't work

  $ie.div(:id,divid).image(:src, /tag_add.png/).click
  Error: failed undefined local variable or method `document' for
  #Watir::Div:0x2c88898

  To elaborate more on the issue, Its html page with 20 rows and one
  them will be higlighted/selected any given time(DIVclass=file-
  titleSelected indicates it's a active/higlighted row). I want to
  click image belongs to this row.

  Note: I am using watri 1.4 and so I can't use multiple param support

  Thanks
  Shiv

  DIVclass=file-titleid=f1IMG src=https://k27/images/
  tag_add.png border=0 //A/DIV
  DIVclass=file-titleid=f2IMG src=https://k27/images/
  tag_add.png border=0 //A/DIV
  DIVclass=file-titleid=f3IMG src=https://k27/images/
  tag_add.png border=0 //A/DIV
  DIVclass=file-titleSelectedid=f4IMG src=https://k27/images/
  tag_add.png border=0 //A/DIV
  DIVclass=file-titleid=f5IMG src=https://k27/images/
  tag_add.png border=0 //A/DIV
  DIVclass=file-titleid=f6IMG src=https://k27/images/
  tag_add.png border=0 //A/DIV
  DIVclass=file-titleid=f7IMG src=https://k27/images/
  tag_add.png border=0 //A/DIV- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Need to access the first LI element within an UL element

2008-12-12 Thread marekj
On Fri, Dec 12, 2008 at 12:09 PM, Bret Pettichord b...@pettichord.comwrote:


 /Signed in as (.*)/.match(browser.ul(:id, 'ulInfoLinks').li(:index,
 1).text)[1]


nice usage of MatchData captures
woot!
bret +1

best,
marekj


 Natasha wrote:
  Hi All,
 
  I want to access the value of the LI element, which is within an UL
  element.
 
  Following is the HTML structure:
 
  UL class=inline id=ulInfoLinks
LI
   Signed in as STRONG username /STRONG
/LI
   LI  /LI
  /UL
 
  Basically I want to retrieve the name of the user that is logged in.
 
  Thanks,
  Natasha


--~--~-~--~~~---~--~~
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: Need to access the first LI element within an UL element

2008-12-12 Thread Darin Duphorn
I'm learning something new everyday.

 

This is awesome.

 

 

 



From: watir-general@googlegroups.com
[mailto:watir-gene...@googlegroups.com] On Behalf Of marekj
Sent: Friday, December 12, 2008 1:47 PM
To: watir-general@googlegroups.com
Subject: [wtr-general] Re: Need to access the first LI element within an
UL element

 

 

On Fri, Dec 12, 2008 at 12:09 PM, Bret Pettichord b...@pettichord.com
wrote:


/Signed in as (.*)/.match(browser.ul(:id, 'ulInfoLinks').li(:index,
1).text)[1]

 


nice usage of MatchData captures 
woot!
bret +1

best, 
marekj
 

Natasha wrote:
 Hi All,

 I want to access the value of the LI element, which is within
an UL
 element.

 Following is the HTML structure:

 UL class=inline id=ulInfoLinks
   LI
  Signed in as STRONG username /STRONG
   /LI
  LI  /LI
 /UL

 Basically I want to retrieve the name of the user that is
logged in.

 Thanks,
 Natasha





--~--~-~--~~~---~--~~
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] Accessing an application's registry keys with Ruby

2008-12-12 Thread jas . shelton

All,

Has anyone discovered a way of accessing an application's registry
keys with Ruby?  I am attempting to access the registry key of the
application under test at runtime of my automated script, so that I
can get the build number of the app from the registry.  Thanks in
advance for any help.

- Shelton
--~--~-~--~~~---~--~~
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: Accessing an application's registry keys with Ruby

2008-12-12 Thread Bill Agee

Check out Win32::Registry - a while ago I was able to use it to do
exactly what you describe.


On Fri, Dec 12, 2008 at 12:39 PM,  jas.shel...@hotmail.com wrote:

 All,

 Has anyone discovered a way of accessing an application's registry
 keys with Ruby?  I am attempting to access the registry key of the
 application under test at runtime of my automated script, so that I
 can get the build number of the app from the registry.  Thanks in
 advance for any help.

 - Shelton
 


--~--~-~--~~~---~--~~
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: It displays error message when I use method bring_to_front.

2008-12-12 Thread Margam

Hello,
I am running into a similar problem also. I was trying to run a script
and got this error:
-
unknown OLE server: 'AutoItX3.Control'
---
As per the entry in FAQ, I tried entering the regsvr32 AutoItX3.dll
command from a command prompt, but get: 'regsvr32' is not a recognized
as an internal or external command, operable program or batch file.

I typed this command from C:\ruby\lib\ruby\gems\1.8\gems
\watir-1.6.2\lib\watir

Can anyone point out what mistake I am doing?

Thank you

Margam

On Nov 13, 11:47 pm, Tony ynot...@gmail.com wrote:
 Hi Wesley,
 Try this.., maybe there was a problem registering the dll file, and
 hence couldn't create an object of 
 AutoIt.regsvr32C:\ruby\lib\ruby\gems\1.8\gems\watir-1.6.2\lib\watir
 \AutoItX3.dll

 Although it does call the register code before creating an object, the
 error was in creating an autoit object.
 -Tony
--~--~-~--~~~---~--~~
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: button.Click_No_Wait only highlights the button, does not click

2008-12-12 Thread pramod D
I am posting a sample code which i am using in my script

*def test_001_Login
$batchCode=0
# attach a new browser window
$ie = Watir::IE.attach(:url,about:blank)
Watir::IE.attach_timeout = 10.0
...
...


$ie.frame(mains).image(:index,1).click_no_wait
begin
hwnd = $ie.enabled_popup(5)
if(hwnd)
popup = WinClicker.new
popup.makeWindowActive(hwnd) #Activate the window.
popup.clickWindowsButton_hwnd(hwnd,OK) #Click the
OK button
end
rescue = e
puts e
puts There is no popup
 end


def test_005_logout

$ie.frame(header).image(:index,5).click
$ie.goto(about:blank)
$ie.minimize()
end

Initially i will open an blank browser manually(This is only for first time)
and then in Login method i am attaching it and continue my script, in logout
method again i am going to direct browser for balnk page. So nxt time when
you re-run the script, blank page is available and script runs smoothly. If
i directly open browser from the script it will not work.

I am not sure what is the exact problem for time being i am using this
approach.
*
On Fri, Dec 12, 2008 at 8:49 PM, Bret Pettichord b...@pettichord.comwrote:


 Your code is correct. There is something about your configuration that
 causes this to fail.

 Bret

 HAHAHA wrote:
  I have tried, using this code:
 
  require 'watir'
 
  browser = Watir::IE.new
  browser.goto('http://www.google.com')
  browser2 = Watir::IE.attach(:title, /Google/)
  browser2.text_field(:name, 'q').set('Watir')
  browser2.button(:name, 'btnG').click_no_wait
 
  The click_no_wait still cannot run. Is the code right?
 
  On Dec 12, 9:58 am, larryni...@gmail.com larryni...@gmail.com
  wrote:
 
  Pramod, could you show us an example of your code?
 
  On Dec 11, 11:01 pm, pramod D petkar.pra...@gmail.com wrote:
 
 
 
 
  Hi Michael,
 
  Initially i also faced same problem when i use Click_no_wait control
 was
  going but never clicked it, To come around this initially i opened the
 IE
  (IE7)with blank page and then, i will attach the browser at the start
 of the
  script and continue to execute my script as usual and worked correctly.
 For
  time being you can fallow this turn around method.
 
  Thanks,
  Pramod
  On Fri, Dec 12, 2008 at 1:46 AM, Michael Hwee michael_h...@yahoo.com
 wrote:
 
  That is disappointing.
  I believe that is something like OS and/or configuration issues,
 rather
  than watir itself.
 
  Michael
 
  - Original Message 
  From: larryni...@gmail.com larryni...@gmail.com
  To: Watir General watir-general@googlegroups.com
  Sent: Thursday, December 11, 2008 12:00:00 PM
  Subject: [wtr-general] Re: button.Click_No_Wait only highlights the
 button,
  does not click
 
  Sorry, Michael, your code doesn't work either.  It opens the page,
  highlights the button yellow, and then just sits there.  No popup is
  ever launched because it doesn't actually click the button.  Watir
  doesn't report any errors, but it never completes, either.  If I
  change click_no_wait to click!, it does launch the popup, but the
  handle_nextpopup command never executes - it's been sitting here for
  90-120 seconds with the popup open not doing anything.  So, again, to
  summarize: click_no_wait is incapable of firing any events, but click!
  makes the script hang.- Hide quoted text -
 
  - Show quoted text -
 
  
 


 


--~--~-~--~~~---~--~~
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: It displays error message when I use method bring_to_front.

2008-12-12 Thread Tony

Hi Margam,

Weird that regsvr32 is not found  hmm...
Anyways could try and search for the regsvr32.exe file in location C:
\WINDOWS\system32

If present run the command from C:\WINDOWS\system32, else try and get
a copy of regsvr32 from another system and copy it to your system.
Should work .. but i doubt that regsvr32 is removed from your system.

-Tony
--~--~-~--~~~---~--~~
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: Accessing an application's registry keys with Ruby

2008-12-12 Thread Tony

Hi Shelton

Here is an example of reading and writing the registry.

require 'win32/registry'

#Common Registry Paths
hkey_local_machine=Win32::Registry::HKEY_LOCAL_MACHINE
hkey_current_user=Win32::Registry::HKEY_CURRENT_USER

# Returns the Microsoft Registry path to the Microsoft software
information
sMSRegPath=SOFTWARE\\Microsoft

def getKeyValue(hive, key_path, key_name)
  reg_obj=hive.open(key_path, Win32::Registry::KEY_READ)
  begin
  reg_typ, reg_val = reg_obj.read(key_name)
   rescue Win32::Registry::Error
  puts key not found : #{key_name}
end
return reg_val
end

#used to set a String value for a key
def setKeyStringValue(hive,key_path, key_name, key_value)
  reg_key=hive.open(key_path, Win32::Registry::KEY_WRITE)
  reg_key.write(key_name,Win32::Registry::REG_SZ,key_value)
end

#used to set a DWord value
def setKeyValue(hive,key_path, key_name, key_value)
  reg_key=hive.open(key_path, Win32::Registry::KEY_WRITE)
  reg_key.write(key_name,Win32::Registry::REG_DWORD,key_value)
end

#eg:usage to get current username or domain
# Returns the Logged in username
def getCurrentUser
return getKeyValue(hkey_local_machine,#{sMSRegPath}\\Windows NT\
\CurrentVersion\\Winlogon,DefaultUserName)
end

#Returns the Logged in Domain
def getCurrentDomain
return getKeyValue(hkey_local_machine,#{sMSRegPath}\\Windows NT\
\CurrentVersion\\Winlogon,DefaultDomainName)
end

Hope this helps you...

-Tony
--~--~-~--~~~---~--~~
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: set watir_browser=ie is not working

2008-12-12 Thread marekj
On Thu, Dec 11, 2008 at 6:14 PM, Margam nk.mar...@gmail.com wrote:


 Hi John,
 So I tried using require 'watir/browser'  in my script and set
 watir_browser=ie from command prompt and everything is OK. IE is
 opened and the scripts runs fine.
 But when I type set watir_browser=firefox from command prompt and
 run the script, IE is still used. Firefox is not launched.
 Am I doing something wrong.


one of two things may be happening:

1) I wonder if you are using two cmd terminals.
The problem with set command on windows is that the whatever you set lasts
only for the duration of the process you are running in that one terminal
window.
So if you set watir_browser=firefox in terminal window 1 and run ruby script
in terminal window 2 it will not know to run it on firefox.

2) or when you type set watir_browser=firefox you can' t have any spaces
so the following is incorrect 'set watir_browser = firefox'

marekj

Also for the time being I am doing to just change the default browser
 from the script itself (which works fine).

 Thank you
 Margam


 On Dec 11, 9:46 am, John Fitisoff jfitis...@yahoo.com wrote:
  I think the problem is that you are requiring watir rather than
 watir/browser. Something like this should work:
 
  require 'rubygems'
  require 'watir/browser'
  set watir_browser=ie
  browser = Watir::Browser.new
  browser.goto(http://www.hotmail.com;)
 
  --- On Wed, 12/10/08, Margam nk.mar...@gmail.com wrote:
 
   From: Margam nk.mar...@gmail.com
   Subject: [wtr-general] set watir_browser=ie is not working
   To: Watir General watir-general@googlegroups.com
   Date: Wednesday, December 10, 2008, 4:45 PM
   HI All,
   I am trying to write one script that will work on both IE
   and FF. As
   per the link:
  http://wiki.openqa.org/display/WTR/Browser.new
 
   I am trying to use the set watir_browser=ie
   command and
   Watir::Browser.new
 
   The code is :
   --
   require 'rubygems'
   require 'watir'
 
   set watir_browser=ie
   browser = Watir::Browser.new
   browser.goto(http://www.hotmail.com;)
   --
 
   But keep getting the following error:
   -
undefined method `set' for main:Object (NoMethodError)
   -
   What am I doing wrong? Should I require any other library?
 
   Thank you.
   Margam


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