Re: [Wtr-general] custom attributes

2007-01-29 Thread Prema Arya

Hi Paul,

You can use xpath to address the elements having custom attributes.

For example, to access the following input tag

input type=text name=aa mytag=paul

using xpath the code would look like this:

inText = ie.text_field(:xpath , //[EMAIL PROTECTED]'paul']/)
puts inText

Regards,
Prema

On 1/29/07, Paul Rogers [EMAIL PROTECTED] wrote:




Some one asked me off list if they could access the mytag part of some
html like the following

input type = text name = aa mytag=paul

With the 1.5.1-1145 gem you can do this:

puts ie.text_field(:index,1).ole_object.mytag
returns 'paul'


this doesnt seem to work though:

ie.text_field(:mytag ,/p/).flash
causes a MissingWayOfFindingObjectException

Hope that helps others too.

Paul



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





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

[Wtr-general] Getting the current system date through a Watir command

2007-01-29 Thread vijay
Hello people,

I do not know what command to use to make Watir output the current system date 
and to convert it into the desired format, dd-mon- (22-Jan-2007).  I want 
the current system date inorder to check whether a particular field present in 
the application has the currrent date or not.  If anybody could help me, I 
would be thankful.

Thanks, in Advance
Vijay
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6307messageID=17749#17749
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] how to make Watir output the current system date through a command

2007-01-29 Thread vijay
Hello people,

I do not know what command to use to make Watir output the current system date 
and to convert it into the desired format, dd-mon- (22-Jan-2007).  I want 
the current system date inorder to check whether a particular field present in 
the application has the currrent date or not.  If anybody could help me, I 
would be thankful.

Thanks, in Advance
Vijay
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6308messageID=17750#17750
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] How to click an image button

2007-01-29 Thread ankur
Hi all

I am automating test cases for a web application . Can someone please tell me 
how to click on a button which has its value as a image .The code in Html says

img src=images/af/Login_button.jpg

looking for an early response..
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6309messageID=17751#17751
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] how to make Watir output the current system datethrough a command

2007-01-29 Thread Walter Kruse
Hi Vijay
This is a Ruby method, not specific to Watir:

Time.now.strftime(%d-%b-%Y)


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of vijay
Sent: 29 January 2007 01:51 PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] how to make Watir output the current system
datethrough a command

Hello people,

I do not know what command to use to make Watir output the current
system date and to convert it into the desired format, dd-mon-
(22-Jan-2007).  I want the current system date inorder to check whether
a particular field present in the application has the currrent date or
not.  If anybody could help me, I would be thankful.

Thanks, in Advance
Vijay
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6308messageID=17750#17750
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
**
Everything in this e-mail and attachments relating to the official business of 
MultiChoice Africa is proprietary to 
the company. Any view or opinion expressed in this message may be the view of 
the individual and should not automatically 
be ascribed to the company.  If you are not the intended recipient, you may not 
peruse, use, disseminate, distribute or 
copy this message. If you have received this message in error, please notify 
the sender immediately by email, facsimile 
or telephone and destroy the original message.
**
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] BUG: Using XPath

2007-01-29 Thread Prema Arya

Hi,

Please find the attached patch fixing the xpath issue.

Regards,
Prema


On 1/25/07, Bret Pettichord [EMAIL PROTECTED] wrote:


On 1/25/07, Prema Arya [EMAIL PROTECTED] wrote:

  This change should be checked-in in the main branch also, Bret can you
 give me access right to check-in? or someone else also can check-in the
 change.


Please submit a patch.








--
Prema Arya


xpath_bug-fix.patch
Description: Binary data
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] how to make Watir output the current system datethrough a command

2007-01-29 Thread Prema Arya

You can refer this for more date-time formats:
http://www.rubycentral.com/book/ref_c_time.html#Time.strftime


Prema



On 1/29/07, Walter Kruse [EMAIL PROTECTED] wrote:


Hi Vijay
This is a Ruby method, not specific to Watir:

Time.now.strftime(%d-%b-%Y)


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of vijay
Sent: 29 January 2007 01:51 PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] how to make Watir output the current system
datethrough a command

Hello people,

I do not know what command to use to make Watir output the current
system date and to convert it into the desired format, dd-mon-
(22-Jan-2007).  I want the current system date inorder to check whether
a particular field present in the application has the currrent date or
not.  If anybody could help me, I would be thankful.

Thanks, in Advance
Vijay
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6308messageID=17750#17750
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

**
Everything in this e-mail and attachments relating to the official
business of MultiChoice Africa is proprietary to
the company. Any view or opinion expressed in this message may be the view
of the individual and should not automatically
be ascribed to the company.  If you are not the intended recipient, you
may not peruse, use, disseminate, distribute or
copy this message. If you have received this message in error, please
notify the sender immediately by email, facsimile
or telephone and destroy the original message.

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





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

Re: [Wtr-general] Getting the current system date through a Watir command

2007-01-29 Thread Željko Filipin

On 1/29/07, vijay [EMAIL PROTECTED] wrote:


I do not know what command to use to make Watir output the current system
date and to convert it into the desired format, dd-mon- (22-Jan-2007).



Watir can not do it, but Ruby can.

Time.now.strftime(%d-%b-%Y)
= 29-Jan-2007

For more information, see
http://dev.rubycentral.com/ref/ref_c_time.html#strftime
--
Zeljko Filipin
zeljkofilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] How to click an image button

2007-01-29 Thread Prema Arya

Hi,

This code will click the image with name like Login_button.jpg

ie.image(:src, /Login_button.jpg/).click

Prema





On 1/29/07, ankur [EMAIL PROTECTED] wrote:


Hi all

I am automating test cases for a web application . Can someone please tell
me how to click on a button which has its value as a image .The code in Html
says

img src=images/af/Login_button.jpg

looking for an early response..
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6309messageID=17751#17751
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general





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

Re: [Wtr-general] Why does Watir sometimes not open an IE window,

2007-01-29 Thread Nathan
Thank you both for your replies, but no I am not using the -b option to make IE 
run hidden.  This occurs sometimes with both IE6 and IE7.  It seems to be 
unclear what causes this mysterious behavior.  For example I set up a windows 
scheduled task to run a batch file that runs one of my watir scripts, and when 
that task begins an IE OLE server connection is obviously made, but the IE 
window never appears for the duration of the test.  But when I double click on 
the batch file without the task, the IE window usually appears.

Nothing has changed execpet that instead of the Windows task scheduler running 
the batch file, I myself am double clicking on it to run it.  Also I only have 
one screen, and nothing special really going on.  Any other ideas?

Thanks,

Nathan
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6286messageID=17757#17757
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] custom attributes

2007-01-29 Thread Željko Filipin

On 1/29/07, Prema Arya [EMAIL PROTECTED] wrote:


ie.text_field(:xpath , //[EMAIL PROTECTED]'paul']/)



This is so cool.
--
Zeljko Filipin
zeljkofilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] custom attributes

2007-01-29 Thread Paul Rogers
I really only p[osted this for information to others who want to search the 
archives. If its something that occurs a lot, it may be possible to add it to 
watir directly, but Ive never seen these things used.

And does firefox support them? Allow you to access them?

Paul

On 1/29/07, Prema Arya [EMAIL PROTECTED] wrote:


ie.text_field(:xpath , //[EMAIL PROTECTED]'paul']/)



This is so cool.
--
Zeljko Filipin
zeljkofilipin.com
___
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 to click an image button

2007-01-29 Thread Nathan
If your button is actually an image, for example lt;img src=...rt;, then 
you should click on it using @ie.image(:src, ...).click.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6309messageID=17763#17763
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Why does Watir sometimes not open an IE window,

2007-01-29 Thread Ravi
You need to make the scheduled job 'interactive'. It allows the job to interact 
with the desktop of the user who is logged on at the time the job runs. I 
typically schedule jobs through command prompt using at /interactive  I 
guess there is an equivalent in Scheduler as well
-Ravi
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6286messageID=17765#17765
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] how to make Watir output the current system date through a command

2007-01-29 Thread Nathan Christie
This is a Ruby Date object and its functions:

require 'Date'

myDate = Date.today().strftime(%d/%m/%y)
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6308messageID=17766#17766
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Why does Watir sometimes not open an IE window,

2007-01-29 Thread Nathan
Thanks ravishan, I am not using AT to create scheduled tasks, rather SCHTASKS 
(only available in Windows XP) to create my scheduled task on the fly (when I 
need it) from the command line, and there is not an option /INTERACTIVE for 
SCHTASKS.

Any other suggestions?

Nathan
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6286messageID=17768#17768
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir 1.4.1 and 1.5 gems can be installed together, how do I choose?

2007-01-29 Thread Nathan
Thank you very much for your help! :)

Nathan
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6315messageID=17773#17773
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Why does Watir sometimes not open an IE window,

2007-01-29 Thread Nathan
I just resolved my issue with this - you're right, it's not Watir at all, 
rather it had to do with the scheduled task.  In the cases where I did not see 
the browser window, this was because I was logged in as a different user than 
the run user that the scheduled task contained.  So I changed my scripts to use 
the current user as the run user and that fixed it!

Thanks,

Nathan
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6286messageID=17772#17772
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] how to populate hidden text area?

2007-01-29 Thread Suman Goel
Yes. I did what you wrote below and it did not work

 

-Suman

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Sunday, January 28, 2007 3:56 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] how to populate hidden text area?

 

presumably you tried 

 

@ie.text_field(:name, 'J_LDESC').value='yes'

 

and that didnt work?

- Original Message - 

From: Suman Goel mailto:[EMAIL PROTECTED]  

To: wtr-general@rubyforge.org 

Sent: Friday, January 26, 2007 3:54 PM

Subject: [Wtr-general] how to populate hidden text area?

 

This did not work for me as my webpage has J__LDESC(the textarea in
question) as the required field and so, on clicking submit button, I get the
error message to fill in the field.
 
Any other suggestions?
 
Suman
 
 
 
 
 
 
try using the value method:
 
@ie.text_field(:name, ..).value='some text'
 
the set method fires all appropriate evens, and generally obeys what the web
page is doing ( ie not letting you enter something that is hidden) but
value= will get round that
 
Paul
 
 
 
 
 
 
  - Original Message - 
  From: Suman Goel 
  To: wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general  
  Sent: Thursday, January 25, 2007 10:17 PM
  Subject: [Wtr-general] how to populate hidden text area?
 
 
  My webpage has the following code:
 
   
 
  textarea name=J__LDESC
style=visibility:hidden(NULL)/textarea
 
   
 
  My watir test has the following code:
 
   
 
  @ie.text_field(:name, J__LDESC).set(some text)
 
   
 
  I am getting the following error:
 
   
 
1) Error:
 
  test_MemSlot(TestMemSlot):
 
  WIN32OLERuntimeError: focus
 
  OLE error code:800A083E in htmlfile
 
Can't move focus to the control because it is invisible, not
enabled, or of a type that does not accept the focus.
 
  HRESULT error code:0x80020009
 
Exception occurred.
 
  C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in
`method_missing'
 
  C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `set'
 
  C:/workspace/yhj_slot/test/tc_MemSlot.rb:43:in `test_MemSlot'
 
   
 
   
 
  Could someone help me in resolving this issue?
 
   
 
  Thanks

 


  _  


___
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 to populate hidden text area?

2007-01-29 Thread Paul Rogers
can you elaborate on that?
  - Original Message - 
  From: Suman Goel 
  To: wtr-general@rubyforge.org 
  Sent: Monday, January 29, 2007 5:08 PM
  Subject: Re: [Wtr-general] how to populate hidden text area?


  Yes. I did what you wrote below and it did not work

   

  -Suman

   


--

  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
  Sent: Sunday, January 28, 2007 3:56 PM
  To: wtr-general@rubyforge.org
  Subject: Re: [Wtr-general] how to populate hidden text area?

   

  presumably you tried 

   

  @ie.text_field(:name, 'J_LDESC').value='yes'

   

  and that didnt work?

- Original Message - 

From: Suman Goel 

To: wtr-general@rubyforge.org 

Sent: Friday, January 26, 2007 3:54 PM

Subject: [Wtr-general] how to populate hidden text area?

 

This did not work for me as my webpage has J__LDESC(the textarea in question) 
as the required field and so, on clicking submit button, I get the error 
message to fill in the field. Any other suggestions? Suman  try using the 
value method: @ie.text_field(:name, ..).value='some text' the set method fires 
all appropriate evens, and generally obeys what the web page is doing ( ie not 
letting you enter something that is hidden) but value= will get round that Paul 
   - Original Message -   From: Suman Goel   To: wtr-general at 
rubyforge.org   Sent: Thursday, January 25, 2007 10:17 PM  Subject: 
[Wtr-general] how to populate hidden text area?My webpage has the following 
code:   textarea name=J__LDESC 
style=visibility:hidden(NULL)/textarea   My watir test has the 
following code:   @ie.text_field(:name, J__LDESC).set(some 
text)   I am getting the following error: 1) Error:   
test_MemSlot(TestMemSlot):   WIN32OLERuntimeError: focus   OLE error 
code:800A083E in htmlfile Can't move focus to the control because it is 
invisible, not enabled, or of a type that does not accept the focus.   
HRESULT error code:0x80020009 Exception occurred.   
C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `method_missing'  
 C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `set'   
C:/workspace/yhj_slot/test/tc_MemSlot.rb:43:in `test_MemSlot'   Could 
someone help me in resolving this issue?   Thanks 




___
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

Re: [Wtr-general] how to populate hidden text area?

2007-01-29 Thread Paul Rogers
It seems to work fine for me:

irb(main):017:0 puts ie.text_field(:id , /h/).value
abc
= nil
irb(main):018:0 ie.text_field(:id , /h/).set('gg')
WIN32OLERuntimeError: focus
OLE error code:800A083E in htmlfile
  Can't move focus to the control because it is invisible, not enabled, or 
of a type that does not accept the focus.
HRESULT error code:0x80020009
  Exception occurred.
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3888:in 
`method_missing'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3888:in 
`set'
from (irb):18
irb(main):019:0 ie.text_field(:id , /h/).value='fg'
= fg
irb(main):020:0 puts ie.text_field(:id , /h/).value
fg
= nil
irb(main):021:0 Watir::IE::VERSION
= 1.5.1.1145
irb(main):022:0

















  - Original Message - 
  From: Paul Rogers 
  To: wtr-general@rubyforge.org 
  Sent: Monday, January 29, 2007 8:40 PM
  Subject: Re: [Wtr-general] how to populate hidden text area?


  can you elaborate on that?
- Original Message - 
From: Suman Goel 
To: wtr-general@rubyforge.org 
Sent: Monday, January 29, 2007 5:08 PM
Subject: Re: [Wtr-general] how to populate hidden text area?


Yes. I did what you wrote below and it did not work

 

-Suman

 




From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Sunday, January 28, 2007 3:56 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] how to populate hidden text area?

 

presumably you tried 

 

@ie.text_field(:name, 'J_LDESC').value='yes'

 

and that didnt work?

  - Original Message - 

  From: Suman Goel 

  To: wtr-general@rubyforge.org 

  Sent: Friday, January 26, 2007 3:54 PM

  Subject: [Wtr-general] how to populate hidden text area?

   

This did not work for me as my webpage has J__LDESC(the textarea in question) 
as the required field and so, on clicking submit button, I get the error 
message to fill in the field. Any other suggestions? Suman  try using the 
value method: @ie.text_field(:name, ..).value='some text' the set method fires 
all appropriate evens, and generally obeys what the web page is doing ( ie not 
letting you enter something that is hidden) but value= will get round that Paul 
   - Original Message -   From: Suman Goel   To: wtr-general at 
rubyforge.org   Sent: Thursday, January 25, 2007 10:17 PM  Subject: 
[Wtr-general] how to populate hidden text area?My webpage has the following 
code:   textarea name=J__LDESC 
style=visibility:hidden(NULL)/textarea   My watir test has the 
following code:   @ie.text_field(:name, J__LDESC).set(some 
text)   I am getting the following error: 1) Error:   
test_MemSlot(TestMemSlot):   WIN32OLERuntimeError: focus   OLE error 
code:800A083E in htmlfile Can't move focus to the control because it is 
invisible, not enabled, or of a type that does not accept the focus.   
HRESULT error code:0x80020009 Exception occurred.   
C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `method_missing'  
 C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `set'   
C:/workspace/yhj_slot/test/tc_MemSlot.rb:43:in `test_MemSlot'   Could 
someone help me in resolving this issue?   Thanks 


--

  ___
  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___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] how to populate hidden text area?

2007-01-29 Thread Suman Goel
Since my text area is a required field and .value sets the value in the
background, when submitting the form, I get a message to fill in the details
for the required field.

 

I need to fill in the value on UI only. .value sets it in the background. I
need a method like .set which sets the value in UI.

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Monday, January 29, 2007 7:41 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] how to populate hidden text area?

 

can you elaborate on that?

- Original Message - 

From: Suman Goel mailto:[EMAIL PROTECTED]  

To: wtr-general@rubyforge.org 

Sent: Monday, January 29, 2007 5:08 PM

Subject: Re: [Wtr-general] how to populate hidden text area?

 

Yes. I did what you wrote below and it did not work

 

-Suman

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Sunday, January 28, 2007 3:56 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] how to populate hidden text area?

 

presumably you tried 

 

@ie.text_field(:name, 'J_LDESC').value='yes'

 

and that didnt work?

- Original Message - 

From: Suman Goel mailto:[EMAIL PROTECTED]  

To: wtr-general@rubyforge.org 

Sent: Friday, January 26, 2007 3:54 PM

Subject: [Wtr-general] how to populate hidden text area?

 

This did not work for me as my webpage has J__LDESC(the textarea in
question) as the required field and so, on clicking submit button, I get the
error message to fill in the field.
 
Any other suggestions?
 
Suman
 
 
 
 
 
 
try using the value method:
 
@ie.text_field(:name, ..).value='some text'
 
the set method fires all appropriate evens, and generally obeys what the web
page is doing ( ie not letting you enter something that is hidden) but
value= will get round that
 
Paul
 
 
 
 
 
 
  - Original Message - 
  From: Suman Goel 
  To: wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general  
  Sent: Thursday, January 25, 2007 10:17 PM
  Subject: [Wtr-general] how to populate hidden text area?
 
 
  My webpage has the following code:
 
   
 
  textarea name=J__LDESC
style=visibility:hidden(NULL)/textarea
 
   
 
  My watir test has the following code:
 
   
 
  @ie.text_field(:name, J__LDESC).set(some text)
 
   
 
  I am getting the following error:
 
   
 
1) Error:
 
  test_MemSlot(TestMemSlot):
 
  WIN32OLERuntimeError: focus
 
  OLE error code:800A083E in htmlfile
 
Can't move focus to the control because it is invisible, not
enabled, or of a type that does not accept the focus.
 
  HRESULT error code:0x80020009
 
Exception occurred.
 
  C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in
`method_missing'
 
  C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `set'
 
  C:/workspace/yhj_slot/test/tc_MemSlot.rb:43:in `test_MemSlot'
 
   
 
   
 
  Could someone help me in resolving this issue?
 
   
 
  Thanks

 


  _  


___
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

Re: [Wtr-general] how to populate hidden text area?

2007-01-29 Thread Paul Rogers
can you post the html of the text area and of the button - there may be some 
javascript going on.

I also dont understand that if its a required field that its also hidden?

Paul
  - Original Message - 
  From: Suman Goel 
  To: wtr-general@rubyforge.org 
  Sent: Monday, January 29, 2007 9:12 PM
  Subject: Re: [Wtr-general] how to populate hidden text area?


  Since my text area is a required field and .value sets the value in the 
background, when submitting the form, I get a message to fill in the details 
for the required field.

   

  I need to fill in the value on UI only. .value sets it in the background. I 
need a method like .set which sets the value in UI.

   


--

  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
  Sent: Monday, January 29, 2007 7:41 PM
  To: wtr-general@rubyforge.org
  Subject: Re: [Wtr-general] how to populate hidden text area?

   

  can you elaborate on that?

- Original Message - 

From: Suman Goel 

To: wtr-general@rubyforge.org 

Sent: Monday, January 29, 2007 5:08 PM

Subject: Re: [Wtr-general] how to populate hidden text area?

 

Yes. I did what you wrote below and it did not work

 

-Suman

 




From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Sunday, January 28, 2007 3:56 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] how to populate hidden text area?

 

presumably you tried 

 

@ie.text_field(:name, 'J_LDESC').value='yes'

 

and that didnt work?

  - Original Message - 

  From: Suman Goel 

  To: wtr-general@rubyforge.org 

  Sent: Friday, January 26, 2007 3:54 PM

  Subject: [Wtr-general] how to populate hidden text area?

   

This did not work for me as my webpage has J__LDESC(the textarea in question) 
as the required field and so, on clicking submit button, I get the error 
message to fill in the field. Any other suggestions? Suman  try using the 
value method: @ie.text_field(:name, ..).value='some text' the set method fires 
all appropriate evens, and generally obeys what the web page is doing ( ie not 
letting you enter something that is hidden) but value= will get round that Paul 
   - Original Message -   From: Suman Goel   To: wtr-general at 
rubyforge.org   Sent: Thursday, January 25, 2007 10:17 PM  Subject: 
[Wtr-general] how to populate hidden text area?My webpage has the following 
code:   textarea name=J__LDESC 
style=visibility:hidden(NULL)/textarea   My watir test has the 
following code:   @ie.text_field(:name, J__LDESC).set(some 
text)   I am getting the following error: 1) Error:   
test_MemSlot(TestMemSlot):   WIN32OLERuntimeError: focus   OLE error 
code:800A083E in htmlfile Can't move focus to the control because it is 
invisible, not enabled, or of a type that does not accept the focus.   
HRESULT error code:0x80020009 Exception occurred.   
C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `method_missing'  
 C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `set'   
C:/workspace/yhj_slot/test/tc_MemSlot.rb:43:in `test_MemSlot'   Could 
someone help me in resolving this issue?   Thanks 


--

  ___
  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___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] how to populate hidden text area?

2007-01-29 Thread Suman Goel
Hi Paul,

There is definitely some java script going on because I don't see anything
in the html. Please have a look at the html.

Suman

 

HTML for BUTTON (Next Step)

td class=input

table width=100% cellspacing=0 cellpadding=0
border=0

tr

td class=input/td

td class=input align=rightinput type=submit
value=Next Step class=button100/td

 

 

HTML for BUTTON(I guess this is the javascript action being called)

tdform action=/member/cgi-bin/job-add method=post
name=HTMLeditorForm onsubmit=return (validateDescriptions(this.J__SDESC ,
this.J__LDESC, this)  copy_values(this));/td

 

 

HTML for textarea

textarea name=J__LDESC
style=visibility:hidden(NULL)/textarea

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Monday, January 29, 2007 8:35 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] how to populate hidden text area?

 

can you post the html of the text area and of the button - there may be some
javascript going on.

 

I also dont understand that if its a required field that its also hidden?

 

Paul

- Original Message - 

From: Suman Goel mailto:[EMAIL PROTECTED]  

To: wtr-general@rubyforge.org 

Sent: Monday, January 29, 2007 9:12 PM

Subject: Re: [Wtr-general] how to populate hidden text area?

 

Since my text area is a required field and .value sets the value in the
background, when submitting the form, I get a message to fill in the details
for the required field.

 

I need to fill in the value on UI only. .value sets it in the background. I
need a method like .set which sets the value in UI.

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Monday, January 29, 2007 7:41 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] how to populate hidden text area?

 

can you elaborate on that?

- Original Message - 

From: Suman Goel mailto:[EMAIL PROTECTED]  

To: wtr-general@rubyforge.org 

Sent: Monday, January 29, 2007 5:08 PM

Subject: Re: [Wtr-general] how to populate hidden text area?

 

Yes. I did what you wrote below and it did not work

 

-Suman

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Sunday, January 28, 2007 3:56 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] how to populate hidden text area?

 

presumably you tried 

 

@ie.text_field(:name, 'J_LDESC').value='yes'

 

and that didnt work?

- Original Message - 

From: Suman Goel mailto:[EMAIL PROTECTED]  

To: wtr-general@rubyforge.org 

Sent: Friday, January 26, 2007 3:54 PM

Subject: [Wtr-general] how to populate hidden text area?

 

This did not work for me as my webpage has J__LDESC(the textarea in
question) as the required field and so, on clicking submit button, I get the
error message to fill in the field.
 
Any other suggestions?
 
Suman
 
 
 
 
 
 
try using the value method:
 
@ie.text_field(:name, ..).value='some text'
 
the set method fires all appropriate evens, and generally obeys what the web
page is doing ( ie not letting you enter something that is hidden) but
value= will get round that
 
Paul
 
 
 
 
 
 
  - Original Message - 
  From: Suman Goel 
  To: wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general  
  Sent: Thursday, January 25, 2007 10:17 PM
  Subject: [Wtr-general] how to populate hidden text area?
 
 
  My webpage has the following code:
 
   
 
  textarea name=J__LDESC
style=visibility:hidden(NULL)/textarea
 
   
 
  My watir test has the following code:
 
   
 
  @ie.text_field(:name, J__LDESC).set(some text)
 
   
 
  I am getting the following error:
 
   
 
1) Error:
 
  test_MemSlot(TestMemSlot):
 
  WIN32OLERuntimeError: focus
 
  OLE error code:800A083E in htmlfile
 
Can't move focus to the control because it is invisible, not
enabled, or of a type that does not accept the focus.
 
  HRESULT error code:0x80020009
 
Exception occurred.
 
  C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in
`method_missing'
 
  C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `set'
 
  C:/workspace/yhj_slot/test/tc_MemSlot.rb:43:in `test_MemSlot'
 
   
 
   
 
  Could someone help me in resolving this issue?
 
   
 
  Thanks

 


  _  


___
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

___

[Wtr-general] url for link

2007-01-29 Thread Naga Harish Kanegolla
Hi all,
   Till now I am using ie.link(:url,http//www.xyz/abc.html) for a link in 
watir.Now I have a problem for the ajax link. i.e., the url obtained in the 
html source is 
a href=# onclick=new 
Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', 
{asynchronous:true, evalScripts:true}); return false;add a term/a

So how could i use this url for the link in watir?? Please tell me the syntax 
in watir for using such type of ajax links. Actually i am having the same add 
a term more than 10 . so i can't use the text link.Please help me out such 
types.

Thanks in Advance
Harish
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6325messageID=17798#17798
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] bug with text_fields.show

2007-01-29 Thread Paul Rogers
irb(main):012:0 ie.showAllObjects
---Objects in page -
text  name=aa id= value=  
alt=
textarea  name=hidden id=hvalue=
= nil
irb(main):013:0 ie.text_fields.show
index id  name
1
2
= nil
irb(main):014:0 Watir::IE::VERSION
= 1.5.1.1145



This seems to be the same issue as wtr-93 ( 
http://jira.openqa.org/browse/WTR-93 ) but for text fields and areas

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

Re: [Wtr-general] custom attributes

2007-01-29 Thread Prema Arya

Yes we can do it in FireWatir also, there are two ways you can do:

require 'firewatir'
include FireWatir

ff = Firefox.new(5)

ff.goto(file:///F:/extras/firewatir/custom.html)
puts ff.text_field(:custom, custom).value
puts ff.text_field(:id, id).attribute_value(custom)
ff.close
html code
--
html
body
form
input id=id value=Prema custom=custom
/form
/body
/html
ouput is:

Prema

On 1/29/07, Paul Rogers [EMAIL PROTECTED] wrote:


I really only p[osted this for information to others who want to search
the archives. If its something that occurs a lot, it may be possible to add
it to watir directly, but Ive never seen these things used.

And does firefox support them? Allow you to access them?


Paul


On 1/29/07, Prema Arya [EMAIL PROTECTED] wrote:

 ie.text_field(:xpath , //[EMAIL PROTECTED]'paul']/)



This is so cool.
--
Zeljko Filipin
zeljkofilipin.com
___
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





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

Re: [Wtr-general] how to populate hidden text area?

2007-01-29 Thread Suman Goel
I forgot to mention in my previous email that on irb, this solution is
working as displayed below. But in IE, it does not since the text field is a
required field and expecting a value at the time of clicking the submit
button. I need some way to overlook that required flag of the field.

 

Thanks

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Monday, January 29, 2007 8:04 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] how to populate hidden text area?

 

It seems to work fine for me:

 

irb(main):017:0 puts ie.text_field(:id , /h/).value
abc
= nil
irb(main):018:0 ie.text_field(:id , /h/).set('gg')
WIN32OLERuntimeError: focus
OLE error code:800A083E in htmlfile
  Can't move focus to the control because it is invisible, not enabled,
or of a type that does not accept the focus.
HRESULT error code:0x80020009
  Exception occurred.
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3888:in
`method_missing'
from
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3888:in `set'
from (irb):18
irb(main):019:0 ie.text_field(:id , /h/).value='fg'
= fg
irb(main):020:0 puts ie.text_field(:id , /h/).value
fg
= nil
irb(main):021:0 Watir::IE::VERSION
= 1.5.1.1145
irb(main):022:0

 

 

 

 

 

 

 

 

 

 

 

 

 


 

 

 

- Original Message - 

From: Paul Rogers mailto:[EMAIL PROTECTED]  

To: wtr-general@rubyforge.org 

Sent: Monday, January 29, 2007 8:40 PM

Subject: Re: [Wtr-general] how to populate hidden text area?

 

can you elaborate on that?

- Original Message - 

From: Suman Goel mailto:[EMAIL PROTECTED]  

To: wtr-general@rubyforge.org 

Sent: Monday, January 29, 2007 5:08 PM

Subject: Re: [Wtr-general] how to populate hidden text area?

 

Yes. I did what you wrote below and it did not work

 

-Suman

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Sunday, January 28, 2007 3:56 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] how to populate hidden text area?

 

presumably you tried 

 

@ie.text_field(:name, 'J_LDESC').value='yes'

 

and that didnt work?

- Original Message - 

From: Suman Goel mailto:[EMAIL PROTECTED]  

To: wtr-general@rubyforge.org 

Sent: Friday, January 26, 2007 3:54 PM

Subject: [Wtr-general] how to populate hidden text area?

 

This did not work for me as my webpage has J__LDESC(the textarea in
question) as the required field and so, on clicking submit button, I get the
error message to fill in the field.
 
Any other suggestions?
 
Suman
 
 
 
 
 
 
try using the value method:
 
@ie.text_field(:name, ..).value='some text'
 
the set method fires all appropriate evens, and generally obeys what the web
page is doing ( ie not letting you enter something that is hidden) but
value= will get round that
 
Paul
 
 
 
 
 
 
  - Original Message - 
  From: Suman Goel 
  To: wtr-general at rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general  
  Sent: Thursday, January 25, 2007 10:17 PM
  Subject: [Wtr-general] how to populate hidden text area?
 
 
  My webpage has the following code:
 
   
 
  textarea name=J__LDESC
style=visibility:hidden(NULL)/textarea
 
   
 
  My watir test has the following code:
 
   
 
  @ie.text_field(:name, J__LDESC).set(some text)
 
   
 
  I am getting the following error:
 
   
 
1) Error:
 
  test_MemSlot(TestMemSlot):
 
  WIN32OLERuntimeError: focus
 
  OLE error code:800A083E in htmlfile
 
Can't move focus to the control because it is invisible, not
enabled, or of a type that does not accept the focus.
 
  HRESULT error code:0x80020009
 
Exception occurred.
 
  C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in
`method_missing'
 
  C:/ruby1.8.5/ruby/lib/ruby/site_ruby/1.8/watir.rb:3399:in `set'
 
  C:/workspace/yhj_slot/test/tc_MemSlot.rb:43:in `test_MemSlot'
 
   
 
   
 
  Could someone help me in resolving this issue?
 
   
 
  Thanks

 


  _  


___
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

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

Re: [Wtr-general] url for link

2007-01-29 Thread Ryan Doherty
  The best way to do this is to completely seperate your markup (html) 
from your behaviour (js). Your link should actually point to a real URL 
that works in case someone has JS turned off. This way you can select 
the link with ie.link(:url, 'linkurl').

If you give the url a unique id or even a class that all ajax urls will 
use, you can use JS (most likely a JS library) to select the links and 
add event handlers to them (and possibly parse the url to understand 
what the request params are), making the AJAX call and killing the event 
so the browser doesn't actually request the page. That's how I would do it.

-Ryan

Naga Harish Kanegolla wrote:
 Hi all,
Till now I am using ie.link(:url,http//www.xyz/abc.html) for a link in 
 watir.Now I have a problem for the ajax link. i.e., the url obtained in the 
 html source is 
 a href=# onclick=new 
 Ajax.Request('/data_entry/ajax_add_term/131?contract_id=227', 
 {asynchronous:true, evalScripts:true}); return false;add a term/a
 
 So how could i use this url for the link in watir?? Please tell me the syntax 
 in watir for using such type of ajax links. Actually i am having the same 
 add a term more than 10 . so i can't use the text link.Please help me out 
 such types.
 
 Thanks in Advance
 Harish
 -
 Posted via Jive Forums
 http://forums.openqa.org/thread.jspa?threadID=6325messageID=17798#17798
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

-- 
Ryan Doherty
Messenger WebDev
Yahoo! ID: ryan.doherty
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general