Re: [Wtr-general] Does anyone know how to capture an entire screenand compare with image?

2007-05-12 Thread Sergio Pinon
Ok here is the information that I was talking about. I don't actually have 
working samples but in the pdf he talks about the comparisons that he did and 
what he used to compare them. I don't know how you would automate it but here 
is the information. 
http://model.based.testing.googlepages.com/exploratory-automation.pdf

Hope this helps!

-Original Message-
From: [EMAIL PROTECTED] on behalf of Sergio Pinon
Sent: Sat 5/12/2007 11:21 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Does anyone know how to capture an entire screenand 
compare with image?
 
Back in February I attended the dt/td summit. There someone presented on how 
they captured screens and diffed them using a software called Eggplant. I can 
see if I can find the information. 

Chris McMahon might also have it.

-Original Message-
From: "qadude123" <[EMAIL PROTECTED]>
To: "wtr-general@rubyforge.org" 
Sent: 5/12/2007 12:07 AM
Subject: [Wtr-general] Does anyone know how to capture an entire screen and 
compare with image?

Hi,

I'm a newbie with Watir and Ruby.   I would like to capture the entire page and 
compare it to another image.
I've seen that there is a ruby file called screen_capture.rb.   How do I get 
this file?  Does anyone have any working code to capture the entire screen 
including the part that's scrolled off the screen?

Thanks for any suggestions
___
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] Does anyone know how to capture an entire screen and compare with image?

2007-05-12 Thread Sergio Pinon
Back in February I attended the dt/td summit. There someone presented on how 
they captured screens and diffed them using a software called Eggplant. I can 
see if I can find the information. 

Chris McMahon might also have it.

-Original Message-
From: "qadude123" <[EMAIL PROTECTED]>
To: "wtr-general@rubyforge.org" 
Sent: 5/12/2007 12:07 AM
Subject: [Wtr-general] Does anyone know how to capture an entire screen and 
compare with image?

Hi,

I'm a newbie with Watir and Ruby.   I would like to capture the entire page and 
compare it to another image.
I've seen that there is a ruby file called screen_capture.rb.   How do I get 
this file?  Does anyone have any working code to capture the entire screen 
including the part that's scrolled off the screen?

Thanks for any suggestions
___
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] Watir and smartclient

2007-04-19 Thread Sergio Pinon
I was looking for that. I didn't see that message in my list. I must
have accidentally deleted it. Thanks Adam.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adam Reed
Sent: Thursday, April 19, 2007 8:16 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Watir and smartclient

Sadeesh sent this to the list yesterday:

Hi,

Can we use Watir for testing applications developed using smartclient.
(Smartclient will use javascript elements instead of HTML elements.)

Thanks,
Sadeesh Vinoth T
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Thursday, April 19, 2007 9:33 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Watir and smartclient

What is that you are looking for help with?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sadeesh Vinoth
Sent: Thursday, April 19, 2007 7:28 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Watir and smartclient

Can anyone help me.
___
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] Watir and smartclient

2007-04-19 Thread Sergio Pinon
What is that you are looking for help with?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sadeesh Vinoth
Sent: Thursday, April 19, 2007 7:28 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Watir and smartclient

Can anyone help me.
___
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] Your Opinion

2007-03-27 Thread Sergio Pinon
This won't affect anything that you have installed. It is meant to consume 
WATIR. It is self contained.


-Original Message-
From: [EMAIL PROTECTED] on behalf of Walter Kruse
Sent: Tue 3/27/2007 11:08 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Your Opinion
 
How will installing this affect my current Watir installation ?

 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: 28 March 2007 04:09 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Your Opinion

 

I hope this isn't unappropriate but I figured that since it was a
general community for WATIR it would be ok.

I have developed a small test engine for hanlding automated testing of
application UI's. I was looking to get some feedback on how it can
improve. Here is the source forge link to the project:
http://sourceforge.net/projects/after

There is an installer for the latest release. Though the latest changes
that I will mention next haven't been released in an installer yet so
you way want to get the latest files from the repository using SVN.

The goal of the engine is to provide a common testing engine to handle
UI testing of any application type. So I have written application
libraries that consume WATIR for Internet Explorer browsers and one that
consumes AutoIt to handle testing against Windows EXE applications. The
tests are written in XML currently but with the latest change I just
made that is now configurable as well. So I only have an XmlScriptReader
class but there could be an ExcelScriptReader, CSVScriptReader or
whatever else and it could work the same way. Also the results are
output in an XML format and there are XSL scripts available that would
allow that data to be consumed by CruiseControl or other continuous
integration systems.

Thanks again for any feedback that you can offer. 


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

[Wtr-general] Your Opinion

2007-03-27 Thread Sergio Pinon
I hope this isn’t unappropriate but I figured that since it was a general 
community for WATIR it would be ok.

I have developed a small test engine for hanlding automated testing of 
application UI’s. I was looking to get some feedback on how it can improve. 
Here is the source forge link to the project: 
http://sourceforge.net/projects/after

There is an installer for the latest release. Though the latest changes that I 
will mention next haven’t been released in an installer yet so you way want to 
get the latest files from the repository using SVN.
 
The goal of the engine is to provide a common testing engine to handle UI 
testing of any application type. So I have written application libraries that 
consume WATIR for Internet Explorer browsers and one that consumes AutoIt to 
handle testing against Windows EXE applications. The tests are written in XML 
currently but with the latest change I just made that is now configurable as 
well. So I only have an XmlScriptReader class but there could be an 
ExcelScriptReader, CSVScriptReader or whatever else and it could work the same 
way. Also the results are output in an XML format and there are XSL scripts 
available that would allow that data to be consumed by CruiseControl or other 
continuous integration systems.
 
Thanks again for any feedback that you can offer.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] WIN32OLERuntimeError: unknown property or method`readOnly'

2007-03-08 Thread Sergio Pinon
Jeff,

I'm sure Charley will answer this as well but I just looked at it right
now and if you look at the page source you will see that the control you
were trying to access was a label and not a textfield. The label had the
id of label_user_email. The textbox had the id of user_email. You
probably just accidentally were looking at the label control and not the
textbox control when you were determining the id to use.

 

Sergio

 



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jeff Fry
Sent: Thursday, March 08, 2007 1:26 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] WIN32OLERuntimeError: unknown property or
method`readOnly'

 

Thanks Charlie - you rock! 

Out of curiosity, how did you know to change (:id, 'label_user_email')
to (:id, 'user_email') ? Was there something in the page source that I
missed? Or did you just experiment with taking 'label_' off? 

...Or asked differently, why did using 'label_user_email' give the error
it did, rather than just telling me that the object was not found?

Jeff



On 3/8/07, Charley Baker <[EMAIL PROTECTED]> wrote:

Had to change the id's you were using to access the html elements, this
should work: 

require 'watir' 

include Watir 

require 'test/unit'

class TC_SendManyMessages < Test::Unit::TestCase 

$email = '[EMAIL PROTECTED]'

$pw = 'password' 



def test_send_many_messages 

ie =
IE.start('http://www.divinecaroline.com/public/login/show_login_page'
 )

ie.text_field(:id, 'user_email').set($email)

ie.text_field(:id,'user_password').set($pw)

ie.button(:name, 'login_button').click

end

end

-Charley





On 3/8/07, Jeff Fry < [EMAIL PROTECTED]  >
wrote:

Hey Charley, thanks for taking a look! Yeah, I mistakenly pasted an
internal url. Our public site is:
http://www.divinecaroline.com/public/login/show_login_page
 
Jeff

 

On 3/8/07, Charley Baker <[EMAIL PROTECTED] > wrote:

Hey Jeff, 

  I'm not able to get to the site you have listed in your test, seems
the url might be local to your internal network? When you include
unittests/setup there's a line at the beginning there: END {$ie.close if
$ie; Watir:: IE.quit} which closes ie when your tests are done running. 

-Charley

On 3/7/07, Jeff Fry < [EMAIL PROTECTED]  >
wrote:

Hi all, 
I am getting an unfamiliar error and hoping someone can lend a
hand. 

I'm currently using Watir 1.5.1.1145
I just got:

>ruby create_many_messages.rb
Loaded suite create_many_messages
Started
E
Finished in 4.544 seconds.

  1) Error:
test_send_many_messages(TC_SendManyMessages):
WIN32OLERuntimeError: unknown property or method `readOnly' 
HRESULT error code:0x80020006
  Unknown name.
(eval):3:in `invoke'
(eval):3:in `readonly?'

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3798:in
`assert_not_readonly' 

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:3884:in `set'
create_many_messages.rb:17:in `test_send_many_messages'

1 tests, 0 assertions, 0 failures, 1 errors
>Exit code: 1 


After trying:

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0
== __FILE__ 
require 'unittests/setup'

class TC_SendManyMessages < Test::Unit::TestCase
  include Watir
  
  $email = " [EMAIL PROTECTED]  "
  $pw = "password" 
 
  def test_send_many_messages

$ie.goto("http://carolinerr.realgirlsmedia.local/public/login/show_login
_page ") 
$ie.text_field(:id ,"label_user_email").set($email)#
THIS IS THE LINE IT CHOKES ON
$ie.text_field(:id ,"label_user_password").set($pw)
$ie.link(:name, "login_button").click 
  end #def
  
 end


A search of the archives gave me
http://forums.openqa.org/thread.jspa?messageID=10228 ...but this seems
to have been fixed in 9/06, so I think I must be hitting something
different. 

Am I screwing something up here?

BTW, our site is public so the code above should execute for
you...just as poorly as it executes for me. ;0)

Thanks in advance for any help,
Jeff


BTW, I remember in the past watir left IE open unless I
explicitly called ie.close. When I'm coding, I often like to leave IE
open to see where I bombed. Is there a way I can switch back to not
automagically cleaning up while I'm coding? I di

Re: [Wtr-general] Moving to OpenQA.org

2006-03-14 Thread Sergio Pinon








Yeah I will look into them and see what I
come up with.

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bret Pettichord
Sent: Tuesday, March 14, 2006 3:57
PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Moving
to OpenQA.org



 

On 3/12/06, Sergio
 Pinon <[EMAIL PROTECTED]>
wrote:





I don't know. What do you need help with?






There are lots of known bugs mentioned in this email list, some of which have
fixes. A lot of the traffic here is discussing them. ("Is this a known
bug?") 

It would be a big help if you could search through the email list and collect
these items in our new bug tracking system, Jira: http://jira.openqa.org/browse/WTR
 



 








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

Re: [Wtr-general] Moving to OpenQA.org

2006-03-11 Thread Sergio Pinon
I don't know. What do you need help with?



From: [EMAIL PROTECTED] on behalf of Bret Pettichord
Sent: Fri 3/10/2006 8:56 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Moving to OpenQA.org


On 3/10/06, Sergio Pinon <[EMAIL PROTECTED]> wrote: 

I would be able to help.


Glad to hear it. Let us know what you want to help with. What can you do? 


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

Re: [Wtr-general] Moving to OpenQA.org

2006-03-10 Thread Sergio Pinon








I would be able to help.

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bret Pettichord
Sent: Friday, March 10, 2006 3:46
PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Moving to
OpenQA.org



 

We are in the process of moving many of the services that have been
provided on RubyForge.org over to OpenQA.org. You'll be seeing more and more
signs of this, so i thought i would send out a quick status report. If you have
questions or want to help, please speak up. 

Repository 

The source repository has been moved to Subversion (SVN) on OpenQA. You can see
it here:
http://www.openqa.org/watir/cvs.action


All of the existing committers who have requested commit access to the new repo
have been given it.

Previously CVS automatically sent email to an email list whenever a change was
made. We don't have that option with SVN right now, but instead there is an RSS
feed which does about the same thing: 
http://svn.openqa.org/fisheye/rsscfg/watir/

This is a good time for me to talk about a couple of things we get with
Subversion.

1. Every commit gets a global commit number, which effectively amounts to a
tag. What this means is that we can now reliably identify any development
version that you pull out of SVN (in case we have trouble reproducing a bug or
whatever). This in fact will be reported in Watir::IE::VERSION, e.g.:
1.5.0.926. The last number is the SVN revision number, uniquely identifying a
snapshot of the entire code base (not just the watir.rb file).

2. File history is retained when files are renamed or moved. This didn't happen
with CVS and so we were reluctant to rename files or reorganize the code. Now
there is little reason not to do that. 

BTW, there has been some confusion about what it means to "check out"
code from CVS or SVN. Unlike other source control systems, neither CVS nor SVN
allow or support locking files. So anyone can check out files. But these
systems have checks in place that check to see if anyone has modified any of
the files you are checking in since you checked them out. If so, you will have
to merge your changes with theirs. 

Wiki

We are migrating the wiki to the Confluence wiki on OpenQA. I've
started the process, but there is still plenty of work to be done. 
http://wiki.openqa.org/display/WTR

The main advantages of Confluence over what we've used before is that it allows
attachments so it will be easy to set up contributions pages and allow people
with small libraries or example code or whatever to easily share it with
others. We will probably be moving some of the unsupported contributions that
we've previously packaged with Watir to the wiki. (So that only supported code
will be contained in our library). 

Any Watir users can have access to this wiki. Unlike past wiki's, you do need
an account first. (This should keep the wiki spammers away.)

Tracking

I've just started to set up the new bug tracking system. This is
Jira, which is really good. The main problem with the old tracker at RubyForge
was that you couldn't reclassify bugs as features etc. Jira lets you mix them
all together in a single system. You can check this out here. 

http://jira.openqa.org/browse/WTR?report=com.atlassian.jira.plugin.system.project:roadmap-panel

Another good thing about Jira is that it allows people to vote on the features and
fixes that they want most. If there is a bug that you want fixed, feel free to
put it in Jira.

Bret 






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

Re: [Wtr-general] How do you find a specific string in an HTML page?

2006-02-09 Thread Sergio Pinon








I always like to use the _javascript_
objects. So one way is to be able to get the _javascript_ underlying object from
the div reference in WATIR. Then when you get that just call the getAttribute()
method on that object and pull out the attribute that you would like. Another
way would be to use the XML Xpath against the DOM to pull the data that you
want. I am not too familiar with this but I know it can be done.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Carvalho
Sent: Thursday, February 09, 2006
1:14 PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] How do you
find a specific string in an HTML page?



 

Hi there, I am trying to
find a way to find a particular string in an HTML page and save it to a
variable.  It seems simple enough, but I can't find the commands to help
me do it yet.

Our Dot-Net app assigns Unique ID's to various objects within the system. 
For example, if you create a new Customer in an Order-Taking system, the new
Customer is assigned a unique ID (let's call it "customerID"). 
When I look at the HTML page, I see that UID in various places.  For
example:
(a) within a "div" tag (within a custom attribute unrecognised by
Watir)
(b) within an "a href" link (part of the URL - e.g. "http://www.../../ShowCustomer.aspx?mode=edit&customerID=1234asdf-5678hjlk")

I know that I can use the contains_text() to look for text on the page.  I
can also use ie.frame("frameName").html.to_s to capture the contents
of the frame.  So how can I tell Watir to find the "customerID="
phrase and then capture the next [fixed-number] set of characters into a string
variable?

Thanks in advance.

Paul.






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

Re: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd:HelpwithFile.join(File.dirname(__FILE__), '..') ?

2006-01-31 Thread Sergio Pinon
I think we all do. :P

Sergio

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon
Sent: Tuesday, January 31, 2006 12:44 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Anyone use Test::Unit::Reporter?
Fwd:HelpwithFile.join(File.dirname(__FILE__), '..') ?

On 1/31/06, Sergio Pinon <[EMAIL PROTECTED]> wrote:
> You know what I looked back at the history of this group and you
already
> saw it when I first posted it to the group. Here are the links to the
> posts. But I went ahead and attached it again just in case.


So I did.  Thanks again!
(I think I need a vacation... :)   )
-Chris

___
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] Anyone use Test::Unit::Reporter? Fwd: Help withFile.join(File.dirname(__FILE__), '..') ?

2006-01-31 Thread Sergio Pinon
Chris,
I have no idea what Reporter is but a while back I submitted a testing
framework that sits on top of WATIR and the results are generated in an
xml form which I then have parsed by CCNET. Don't know if this is
something that you are looking for but if you would like to check it out
I can send it to you.

Sergio

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon
Sent: Monday, January 30, 2006 8:02 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help
withFile.join(File.dirname(__FILE__), '..') ?

> By the way, I still hold the admin rights to the corresponding
RubyForge
> project. if you use Test::Unit::Reporter nowadays and want it to suck
> less, feel free to create yourself a RubyForge account and write me
for
> the commit rights.

Apologies, but is there anything besides Reporter that would help me
talk to CCNET that sucks less than Reporter?  I've got a rubyforge
account, but I'm a lot more interested in talking to CruiseControl
than I am in have Reporter not suck.  Call it pragmatism :)

-Chris

___
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] Tab Click

2006-01-26 Thread Sergio Pinon








Agreed. We need something to work from.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Bolton
Sent: Thursday, January 26, 2006
3:12 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



 

We know that they're not generating an ID;
that's clear from the HTML.  What Sergio was suggesting is that you ask
them to do so.

 

Can we /please/ see some of your
Watir/Ruby code?  This may be failing for entirely different reasons that
our assumptions suggest.

 

 

---Michael B.

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath 
Sent: January 26, 2006 6:06 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



Hi





 





I asked the Dev. team about the ID, they
confirmed there are not generating any id





 





Thanks





Meghanath





 





 





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Sergio
 Pinon
Sent: Thursday, January 26, 2006
4:12 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

Did you try the solution that I mentioned.
Give the td an id attribute and then you are golden. You shouldn’t have
any problems.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
12:00 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



 



Hi 





 





I stepped through the IRB and getting the
following error exception. I used link, button , image etc





 





Watir::Exception::UnknownObjectException:
Unable to locate object, using value a
nd (?-mix:Contents)





 





When I used "div", its not
throwing any message, but no object is returned.





 





Thanks





Meghanath





 





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Sergio
 Pinon
Sent: Thursday, January 26, 2006
2:03 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

Some thoughts:

 

Can you give the td that contains the text
you want clicked an ID attribute. If so then you could try accessing the td
directly and calling the click method on it. This can be done with _javascript_
using the following code.

 

ie_browser.getDocument().getElementById(“[table
cell id]”).click()

 

That should work if you can do something
like that.

 









From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
10:27 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



 



HI All





 





Can anyone , give  solution, I am
struck at this point .





 





Thanks





Meghanath





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
9:58 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



Hi





 





I tried with this options also , but not
working.





It is not throwing any error, but its not
clicking that 'Tab'





 





Thanks





Meghanath





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Bret Pettichord
Sent: Wednesday, January 25, 2006
4:09 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

How 'bout this:

  ie.div(:id, 'LineTab').cell(:text, 'Contents').click

(If this doesn't work, please describe what it actually does. Error?)

Bret



On 1/25/06, Chintakrindi
Meghanath <[EMAIL PROTECTED]>
wrote: 



Hi 





 





I aleady tried with that option , but its
not working





 





Thanks





Meghanath







-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Bret Pettichord
Sent: Wednesday, January 25, 2006
2:10 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

ie.div(:id,
'LineTab').click



On 1/25/06, Chintakrindi
Meghanath <
[EMAIL PROTECTED] > wrote:




Hi All





 





My web application contains two tabs in one of the
transaction "Detail" and "Contents"





After entering the data in the Detail page, using will be
saving that record and clicks on "Contents".





I am trying to make a script for that





Can anyone help me out, how to click on
"Contents".





I tried with most of the objects, but its not going through.





The following is the source code





 





 





 








Detail
Contents







Detail
Contents









 



Thanks

Meghanath


___
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] Tab Click

2006-01-26 Thread Sergio Pinon








If you gave that cell an id here is one
way you can do it. Though there is also an Xpath _expression_ you can use though
I’m not too good with that.

 

ie_browser.getDocument().getElementById(“[table
cell id]”).click()

 

Try this.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
2:14 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



 



Hi





 





Can you help me, how to get that table
cell id





 





Thanks





Meghanath





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Sergio
 Pinon
Sent: Thursday, January 26, 2006
4:12 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

Did you try the solution that I mentioned.
Give the td an id attribute and then you are golden. You shouldn’t have
any problems.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
12:00 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



 



Hi 





 





I stepped through the IRB and getting the
following error exception. I used link, button , image etc





 





Watir::Exception::UnknownObjectException:
Unable to locate object, using value a
nd (?-mix:Contents)





 





When I used "div", its not
throwing any message, but no object is returned.





 





Thanks





Meghanath





 





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Sergio
 Pinon
Sent: Thursday, January 26, 2006
2:03 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

Some thoughts:

 

Can you give the td that contains the text
you want clicked an ID attribute. If so then you could try accessing the td
directly and calling the click method on it. This can be done with _javascript_
using the following code.

 

ie_browser.getDocument().getElementById(“[table
cell id]”).click()

 

That should work if you can do something
like that.

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
10:27 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



 



HI All





 





Can anyone , give  solution, I am
struck at this point .





 





Thanks





Meghanath





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
9:58 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



Hi





 





I tried with this options also , but not
working.





It is not throwing any error, but its not
clicking that 'Tab'





 





Thanks





Meghanath





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]On
Behalf Of Bret Pettichord
Sent: Wednesday, January 25, 2006
4:09 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

How 'bout this:

  ie.div(:id, 'LineTab').cell(:text, 'Contents').click

(If this doesn't work, please describe what it actually does. Error?)

Bret



On 1/25/06, Chintakrindi
Meghanath <[EMAIL PROTECTED]>
wrote: 



Hi 





 





I aleady tried with that option , but its
not working





 





Thanks





Meghanath







-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Bret Pettichord
Sent: Wednesday, January 25, 2006
2:10 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

ie.div(:id,
'LineTab').click



On 1/25/06, Chintakrindi
Meghanath <
[EMAIL PROTECTED] > wrote:




Hi All





 





My web application contains two tabs in one of the
transaction "Detail" and "Contents"





After entering the data in the Detail page, using will be
saving that record and clicks on "Contents".





I am trying to make a script for that





Can anyone help me out, how to click on
"Contents".





I tried with most of the objects, but its not going through.





The following is the source code





 





 





 








Detail
Contents







Detail
Contents









 



Thanks

Meghanath


___
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] Tab Click

2006-01-26 Thread Sergio Pinon








Did you try the solution that I mentioned.
Give the td an id attribute and then you are golden. You shouldn’t have
any problems.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
12:00 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



 



Hi 





 





I stepped through the IRB and getting the
following error exception. I used link, button , image etc





 





Watir::Exception::UnknownObjectException:
Unable to locate object, using value a
nd (?-mix:Contents)





 





When I used "div", its not
throwing any message, but no object is returned.





 





Thanks





Meghanath





 





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]On
Behalf Of Sergio Pinon
Sent: Thursday, January 26, 2006
2:03 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

Some thoughts:

 

Can you give the td that contains the text
you want clicked an ID attribute. If so then you could try accessing the td
directly and calling the click method on it. This can be done with _javascript_
using the following code.

 

ie_browser.getDocument().getElementById(“[table
cell id]”).click()

 

That should work if you can do something
like that.

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
10:27 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



 



HI All





 





Can anyone , give  solution, I am
struck at this point .





 





Thanks





Meghanath





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
9:58 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



Hi





 





I tried with this options also , but not
working.





It is not throwing any error, but its not
clicking that 'Tab'





 





Thanks





Meghanath





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Bret Pettichord
Sent: Wednesday, January 25, 2006
4:09 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

How 'bout this:

  ie.div(:id, 'LineTab').cell(:text, 'Contents').click

(If this doesn't work, please describe what it actually does. Error?)

Bret



On 1/25/06, Chintakrindi
Meghanath <[EMAIL PROTECTED]>
wrote: 



Hi 





 





I aleady tried with that option , but its
not working





 





Thanks





Meghanath







-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Bret Pettichord
Sent: Wednesday, January 25, 2006
2:10 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

ie.div(:id,
'LineTab').click



On 1/25/06, Chintakrindi
Meghanath <
[EMAIL PROTECTED] > wrote:




Hi All





 





My web application contains two tabs in one of the
transaction "Detail" and "Contents"





After entering the data in the Detail page, using will be
saving that record and clicks on "Contents".





I am trying to make a script for that





Can anyone help me out, how to click on
"Contents".





I tried with most of the objects, but its not going through.





The following is the source code





 





 





 








Detail
Contents







Detail
Contents









 



Thanks

Meghanath


___
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] Tab Click

2006-01-26 Thread Sergio Pinon








Some thoughts:

 

Can you give the td that contains the text
you want clicked an ID attribute. If so then you could try accessing the td
directly and calling the click method on it. This can be done with _javascript_ using
the following code.

 

ie_browser.getDocument().getElementById(“[table
cell id]”).click()

 

That should work if you can do something
like that.

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
10:27 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



 



HI All





 





Can anyone , give  solution, I am
struck at this point .





 





Thanks





Meghanath





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Chintakrindi Meghanath 
Sent: Thursday, January 26, 2006
9:58 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click



Hi





 





I tried with this options also , but not
working.





It is not throwing any error, but its not
clicking that 'Tab'





 





Thanks





Meghanath





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Bret Pettichord
Sent: Wednesday, January 25, 2006
4:09 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

How 'bout this:

  ie.div(:id, 'LineTab').cell(:text, 'Contents').click

(If this doesn't work, please describe what it actually does. Error?)

Bret



On 1/25/06, Chintakrindi
Meghanath <[EMAIL PROTECTED]>
wrote: 



Hi 





 





I aleady tried with that option , but its
not working





 





Thanks





Meghanath







-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Bret Pettichord
Sent: Wednesday, January 25, 2006
2:10 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tab
Click

ie.div(:id,
'LineTab').click



On 1/25/06, Chintakrindi
Meghanath <
[EMAIL PROTECTED] > wrote:




Hi All





 





My web application contains two tabs in one of the
transaction "Detail" and "Contents"





After entering the data in the Detail page, using will be
saving that record and clicks on "Contents".





I am trying to make a script for that





Can anyone help me out, how to click on
"Contents".





I tried with most of the objects, but its not going through.





The following is the source code





 





 





 








Detail
Contents







Detail
Contents









 



Thanks

Meghanath


___
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] Another JavaScript Question

2006-01-26 Thread Sergio Pinon








This might be another possibility to try:

 

Get the underlying _javascript_ DOM object from
the browser:

js_dom =
ie_browser.getDocument();

 

At this point you can execute any
_javascript_ methods you want against the browser. Since you don’t have any
name or id attributes you can get the objects by type.

hyperlinks
= js_dom.getElementsByTagName(“”A”);

 

At the point the hyperlinks variable
represents a collection of all of the links in your page. So if you know the
index of the hyperlink you can just do that. Or you can loop through them all
and try to determine which one to use.

hyperlinks[1].click()

 

or 

 

for I in
0..hyperlinks.length

    do
something with à hyperlinks[i]

end

 

Of course this is just one option. I would
say your best option would be to try and give these hyperlinks sometype of
identifier. (name, id, etc…)

 

Sergio









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Solis
Sent: Wednesday, January 25, 2006
9:01 PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Another
_javascript_ Question



 



All,





 





I've been trying desperately for over week to figure out how to click
on _javascript_ button to no avail. I have tried just about everybody's
suggestions. Mark Cain's solution posted last week looked very promising,
but can't get it to work. Here is the code that contains the buttons (cancel
& update) I need to click on:





 



       
td>    "/images/admin/form_top_tile.gif">"/images/admin/spacer.gif" width="10" height="48">td>    "return validate_form('ADMINPayModelUpdate','enable')" >"imgswap('enablealltop', 'form_top_enableall_over'); return false;" >"imgswap('enablealltop', 'form_top_enableall_up'); return false;">"/images/admin/form_top_enableall_up.gif" value="Enable all" border="0">a>"return validate_form('ADMINPayModelUpdate','disable')" >"imgswap('disablealltop', 'form_top_disableall_over'); return false;" >"imgswap('disablealltop', 'form_top_disableall_up'); return false;">"/images/admin/form_top_disableall_up.gif" value="Disable all">a>td>    "/images/admin/form_top_tile.gif">"/images/admin/spacer.gif" width="226" height="48">td>    "_javascript_:document.ADMINPayModel.reset()" >"return validate_form('ADMINPayModelUpdate','cancel')" >"imgswap('canceltop', 'form_top_cancel_over'); return false;" >"imgswap('canceltop', 'form_top_cancel_up'); return false;">"/images/admin/form_top_cancel_up.gif" border="0">a>"#" >"return validate_form('ADMINPayModelUpdate','update')" >"imgswap('updatetop', 'form_top_update_over'); return false;" >"imgswap('updatetop', 'form_top_update_up'); return false;">"/images/admin/form_top_update_up.gif" value="Update" border="0">a>td>    "/images/admin/form_top_tile.gif">"/images/admin/spacer.gif" width="6" height="48">td>    "/images/admin/form_top_right.gif">td>   tr>  table>Thanks!David   Do you Yahoo!? With a free 1 GB, there's more in store with Yahoo! Mail. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Tricky checkbox selection

Title: Tricky checkbox selection








David,

I would need to see the code to see what
is happening. But if you are getting the collection of objects with the same
name and then trying to sort that array you can’t. The reason is that the
array of controls is really not an array it is unique object collection. If you
want to send me some code I can take a look at it and see what I can come up
with. The other thing that may help though I don’t know your circumstance
is that you can use Xpath expressions against the DOM so you might be able to
do something like that. See the previous post below that might be able to help
you out.

 

Sergio

 



PREVIOUS
POST:

 

Hi Paatsch,

 

How about using XPath to get the element in just one
line of code rather then using the loops? In your case it would be something
like

this:

 

ie.checkbox(:xpath, "//td[contains(.,
'Test3')]/../td/input/").click()

 

This XPath query first select the 
containing text Test3 (this is what you said is fixed and known before hand),
then it goes to its parent i.e.  and then traverse down the tree to
first  and then  element inside that  which is
the checkbox element that you want.

 

For using XPath download the tar ball from HEAD and
read the documentation under the docs section.

 

Hope this helps.

 

Regards,

Angrez

 



 

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, January 24, 2006
8:52 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

I ran into a similar problem and your
suggestion worked great. However, I ran into slightly different problem. In my
case, I have a list of users that can be updated and deleted. Every time I add
a user, the value is increased by 1. For example, 

 





 

and so on...

 

To find the last index value, I sorted the
array to give the largest number. Knowing this I can delete the last user created.
The problem is this: When I try to use any of the built in Array methods other
than Sergio example, I get the following error:

 

WIN32OLERuntimeError: Unknown property or method `sort' 
    HRESULT error code:0x80020006 
  Unknown name. 
    C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in
`method_missing' 
    C:/Tests/TestSuites/tc_smoketest_suite.rb:93:in
`test_delete_user 
    C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in
`each' 
    C:/Tests/TestSuites/tc_smoketest_suite.rb:92:in
`test_delete_user 

What am I doing wrong?



 








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

Re: [Wtr-general] Tricky checkbox selection

Title: Tricky checkbox selection








That is close. You can’t access the class
attribute using class. You have to use className. But other than that yes you
are right. Glad to here it worked out.

 

Sergio

 









From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
5:42 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

It works.

 

In order to see the whole input tag
element and its attributes I have to write something like

 

 puts variable.each{|i| print
i.class, i.name, i.value, "\n"}



 





Is this correct?



 

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
2:51 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

If you are trying to see information about
these object then try something like the following:

   variable =
$ie.getDocument().getElementsByName('cbxSelectGroup[]');

   puts variable.each{|i|
print i.value, "\n"}
   puts variable.length

 

Add the value property on to the end of
your object. So you see I did i.value. That should show you the value.

 

Sergio









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
2:21 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

   variable =
$ie.getDocument().getElementsByName('cbxSelectGroup[]');



   puts variable.each{|i|
print i, "\n"}
   puts variable.length





 





As I said, I am new to _javascript_ and
ruby.





The code returns:





#
#
#





etc.





which I believe represents memory
locations? How can I get the values?









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
1:58 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Did you try the method I gave you? I
wanted to know if it worked.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:43 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

The table is generated by an underlining database and the
values are different almost every time.
Only the string in the second  stays the same, e.g "Test1",
"Test2", "Test3"

 

         Test1
 
         Test2
 
         Test3
 

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cain, Mark
Sent: Monday, January 23, 2006
1:38 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

You don’t need to just try something
like this.  

 

$ie.checkbox(:name,
/Add_member/i, “35”).set

 

You can use regular expressions for your
attribute name if you know part of what that name will be at
runtime—although it does get tricky when attribute names for an object
are the same, in that case you can use :index.  Indexes are 1 based
currently (although I heard some rumbling as to think they will soon be zero
based) and start with the first one on the page and continue through the last
one on the page.

 





--Mark





 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:19 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

I have almost none _javascript_ experience.
How do I get the underlying _javascript_ object of that page?

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
11:12 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Well the other thing to do is try the code
below. What you do is get the underlying _javascript_ object of the page and then
interact with it as you would with _javascript_. You get all the elements with
the name you supply and then access the one you want using the indexer on that
array. Then you just set the checked property of that object to true and it
should work. Let me know how it turns out.

 

ie_browser.getDocument().getElementsByName(“Add_member[]”)[index
of control].checked = true;

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:47 AM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

Unfortunately I do not know the value
beforehand.

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
10:45 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Do you know the value of the checkbox
beforehand? If you do then just use this method:

 

Ie_browser.checkbox(:name, “Add_m

Re: [Wtr-general] Tricky checkbox selection

Title: Tricky checkbox selection








The other thing you can try to do is use
the outerHTML properyt which will show you the whole HTML tag. So you would do
the following:

 

 puts variable.each{|i| print i.outerHTML,
"\n"}

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
5:42 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

It works.

 

In order to see the whole input tag
element and its attributes I have to write something like

 

 puts variable.each{|i| print
i.class, i.name, i.value, "\n"}



 





Is this correct?



 

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
2:51 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

If you are trying to see information about
these object then try something like the following:

   variable =
$ie.getDocument().getElementsByName('cbxSelectGroup[]');

   puts variable.each{|i|
print i.value, "\n"}
   puts variable.length

 

Add the value property on to the end of
your object. So you see I did i.value. That should show you the value.

 

Sergio









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
2:21 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

   variable =
$ie.getDocument().getElementsByName('cbxSelectGroup[]');



   puts variable.each{|i|
print i, "\n"}
   puts variable.length





 





As I said, I am new to _javascript_ and
ruby.





The code returns:





#
#
#





etc.





which I believe represents memory
locations? How can I get the values?









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
1:58 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Did you try the method I gave you? I
wanted to know if it worked.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:43 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

The table is generated by an underlining database and the
values are different almost every time.
Only the string in the second  stays the same, e.g "Test1",
"Test2", "Test3"

 

         Test1
 
         Test2
 
         Test3
 

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cain, Mark
Sent: Monday, January 23, 2006
1:38 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

You don’t need to just try something
like this.  

 

$ie.checkbox(:name,
/Add_member/i, “35”).set

 

You can use regular expressions for your
attribute name if you know part of what that name will be at
runtime—although it does get tricky when attribute names for an object
are the same, in that case you can use :index.  Indexes are 1 based
currently (although I heard some rumbling as to think they will soon be zero
based) and start with the first one on the page and continue through the last
one on the page.

 





--Mark





 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:19 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

I have almost none _javascript_ experience.
How do I get the underlying _javascript_ object of that page?

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
11:12 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Well the other thing to do is try the code
below. What you do is get the underlying _javascript_ object of the page and then
interact with it as you would with _javascript_. You get all the elements with
the name you supply and then access the one you want using the indexer on that
array. Then you just set the checked property of that object to true and it
should work. Let me know how it turns out.

 

ie_browser.getDocument().getElementsByName(“Add_member[]”)[index
of control].checked = true;

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:47 AM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

Unfortunately I do not know the value
beforehand.

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
10:45 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Do you know the value of the checkbox
beforehand? If you do then just use this metho

Re: [Wtr-general] Tricky checkbox selection

Title: Tricky checkbox selection








If you are trying to see information about
these object then try something like the following:

   variable =
$ie.getDocument().getElementsByName('cbxSelectGroup[]');

   puts variable.each{|i|
print i.value, "\n"}
   puts variable.length

 

Add the value property on to the end of
your object. So you see I did i.value. That should show you the value.

 

Sergio









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
2:21 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

   variable =
$ie.getDocument().getElementsByName('cbxSelectGroup[]');



   puts variable.each{|i|
print i, "\n"}
   puts variable.length





 





As I said, I am new to _javascript_ and
ruby.





The code returns:





#
#
#





etc.





which I believe represents memory
locations? How can I get the values?









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
1:58 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Did you try the method I gave you? I
wanted to know if it worked.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:43 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

The table is generated by an underlining database and the
values are different almost every time.
Only the string in the second  stays the same, e.g "Test1",
"Test2", "Test3"

 

         Test1
 
         Test2
 
         Test3
 

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cain, Mark
Sent: Monday, January 23, 2006
1:38 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

You don’t need to just try something
like this.  

 

$ie.checkbox(:name,
/Add_member/i, “35”).set

 

You can use regular expressions for your
attribute name if you know part of what that name will be at
runtime—although it does get tricky when attribute names for an object
are the same, in that case you can use :index.  Indexes are 1 based
currently (although I heard some rumbling as to think they will soon be zero
based) and start with the first one on the page and continue through the last
one on the page.

 





--Mark





 









From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:19 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

I have almost none _javascript_ experience.
How do I get the underlying _javascript_ object of that page?

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
11:12 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Well the other thing to do is try the code
below. What you do is get the underlying _javascript_ object of the page and then
interact with it as you would with _javascript_. You get all the elements with the
name you supply and then access the one you want using the indexer on that
array. Then you just set the checked property of that object to true and it
should work. Let me know how it turns out.

 

ie_browser.getDocument().getElementsByName(“Add_member[]”)[index
of control].checked = true;

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:47 AM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

Unfortunately I do not know the value
beforehand.

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
10:45 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Do you know the value of the checkbox
beforehand? If you do then just use this method:

 

Ie_browser.checkbox(:name,
“Add_member[]”, “35”).set(); 

 

This should be good to go.

 

Sergio

 









From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:23 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Tricky
checkbox selection



 

Hello,


I
have following html code and like to select the checkbox for "Test3".
How can I do that? 

 Test1
Subscriber208 
 Test2
Subscriber208 
 Test3
Subscriber208 

 

Thanks.







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

Re: [Wtr-general] Tricky checkbox selection

Title: Tricky checkbox selection








Ok no problem. I was just checking to make
sure everything worked ok. No rush.

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
2:05 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

Got a little sidetracked.

 variable =
$ie.getDocument().getElementsByName("Add_member[]”);

This gives me the list of all three input
elements. Now I need to find the right index. That's what I am working on right
now.

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
1:58 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Did you try the method I gave you? I
wanted to know if it worked.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:43 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

The table is generated by an underlining database and the
values are different almost every time.
Only the string in the second  stays the same, e.g "Test1",
"Test2", "Test3"

 

         Test1
 
         Test2
 
         Test3
 

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cain, Mark
Sent: Monday, January 23, 2006
1:38 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

You don’t need to just try something
like this.  

 

$ie.checkbox(:name,
/Add_member/i, “35”).set

 

You can use regular expressions for your
attribute name if you know part of what that name will be at
runtime—although it does get tricky when attribute names for an object
are the same, in that case you can use :index.  Indexes are 1 based
currently (although I heard some rumbling as to think they will soon be zero
based) and start with the first one on the page and continue through the last
one on the page.

 





--Mark





 









From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:19 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

I have almost none _javascript_ experience.
How do I get the underlying _javascript_ object of that page?

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
11:12 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Well the other thing to do is try the code
below. What you do is get the underlying _javascript_ object of the page and then
interact with it as you would with _javascript_. You get all the elements with the
name you supply and then access the one you want using the indexer on that
array. Then you just set the checked property of that object to true and it
should work. Let me know how it turns out.

 

ie_browser.getDocument().getElementsByName(“Add_member[]”)[index
of control].checked = true;

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:47 AM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

Unfortunately I do not know the value
beforehand.

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
10:45 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Do you know the value of the checkbox
beforehand? If you do then just use this method:

 

Ie_browser.checkbox(:name,
“Add_member[]”, “35”).set(); 

 

This should be good to go.

 

Sergio

 









From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:23 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Tricky
checkbox selection



 

Hello,


I
have following html code and like to select the checkbox for "Test3".
How can I do that? 

 Test1
Subscriber208 
 Test2 Subscriber208

 Test3
Subscriber208 

 

Thanks.







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

Re: [Wtr-general] Tricky checkbox selection

Title: Tricky checkbox selection








Did you try the method I gave you? I
wanted to know if it worked.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:43 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

The table is generated by an underlining database and the
values are different almost every time.
Only the string in the second  stays the same, e.g "Test1",
"Test2", "Test3"

 

         Test1
 
         Test2
 
         Test3
 

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cain, Mark
Sent: Monday, January 23, 2006
1:38 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

You don’t need to just try something
like this.  

 

$ie.checkbox(:name,
/Add_member/i, “35”).set

 

You can use regular expressions for your
attribute name if you know part of what that name will be at
runtime—although it does get tricky when attribute names for an object
are the same, in that case you can use :index.  Indexes are 1 based
currently (although I heard some rumbling as to think they will soon be zero
based) and start with the first one on the page and continue through the last
one on the page.

 





--Mark





 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:19 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

I have almost none _javascript_ experience.
How do I get the underlying _javascript_ object of that page?

 







From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
11:12 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Well the other thing to do is try the code
below. What you do is get the underlying _javascript_ object of the page and then
interact with it as you would with _javascript_. You get all the elements with
the name you supply and then access the one you want using the indexer on that
array. Then you just set the checked property of that object to true and it
should work. Let me know how it turns out.

 

ie_browser.getDocument().getElementsByName(“Add_member[]”)[index
of control].checked = true;

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:47 AM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

Unfortunately I do not know the value
beforehand.

 







From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
10:45 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Do you know the value of the checkbox beforehand?
If you do then just use this method:

 

Ie_browser.checkbox(:name,
“Add_member[]”, “35”).set(); 

 

This should be good to go.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:23 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Tricky
checkbox selection



 

Hello,


I
have following html code and like to select the checkbox for "Test3".
How can I do that? 

 Test1
Subscriber208 
 Test2
Subscriber208 
 Test3
Subscriber208 

 

Thanks.







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

Re: [Wtr-general] Tricky checkbox selection

Title: Tricky checkbox selection








That code I sent you does it already for
you. When you call the getDocument() method it does it. Did you try the code
and see if it works?

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
1:19 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

I have almost none _javascript_ experience.
How do I get the underlying _javascript_ object of that page?

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
11:12 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Well the other thing to do is try the code
below. What you do is get the underlying _javascript_ object of the page and then
interact with it as you would with _javascript_. You get all the elements with
the name you supply and then access the one you want using the indexer on that
array. Then you just set the checked property of that object to true and it
should work. Let me know how it turns out.

 

ie_browser.getDocument().getElementsByName(“Add_member[]”)[index
of control].checked = true;

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:47 AM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

Unfortunately I do not know the value
beforehand.

 







From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
10:45 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Do you know the value of the checkbox
beforehand? If you do then just use this method:

 

Ie_browser.checkbox(:name,
“Add_member[]”, “35”).set(); 

 

This should be good to go.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:23 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Tricky
checkbox selection



 

Hello,


I
have following html code and like to select the checkbox for "Test3".
How can I do that? 

 Test1
Subscriber208 
 Test2
Subscriber208 

Test3
Subscriber208 

 

Thanks.







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

Re: [Wtr-general] Random number generation.









I don’t know too much about the
first problem that you are having but as for your second one try this. I
changed the max to be no higher than 9 and then you get a maximum of 5
digits. If you have less then I just concat zeros on the end. Hope this helps.

 

Sergio

 

def Random_number

   $rand_num =
rand(max=9).to_s()

   

   while $rand_num.length < 5

    $rand_num
<< "0"

   end

   
puts ("tester"+ ($rand_num))

   


   return $rand_num

end









From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Monday, January 23, 2006
11:31 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Random
number generation.



 



I have 2 questions:





 





Can I use method names other then
"test_sometest" in my script. For example, I have a method that
performs a calculation and returns a value and passes that value to test
method. Unless I rename my calculation method as "test_calculation"
the method is not executed. I know that my class is inheriting from test::unit,
but do I need to precede every method name with "test"?





 





Secondly, I am trying to generate test users for my test by
generating a random number and the concatenating that number to a string
"test" so that the result is "test12345", for example.





 





I'm using rand(max-0) to generate the number, but it returns
a big number. So I tried stripping the number and then concatenating but it
didn't work. Ultimately, I would like to have generate names with 5 digits
randomly like the example above. Any ideas?





 





def Random_name
   $rand_num = rand(max=0)
   $rand_num =~ /^0???/





   $rand_user = $rand_num.to_s
    puts ("tester"+
($rand_user))

   return $rand_user
  end





 





 





 








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

Re: [Wtr-general] Tricky checkbox selection

Title: Tricky checkbox selection








Well the other thing to do is try the code
below. What you do is get the underlying _javascript_ object of the page and then
interact with it as you would with _javascript_. You get all the elements with
the name you supply and then access the one you want using the indexer on that
array. Then you just set the checked property of that object to true and it
should work. Let me know how it turns out.

 

ie_browser.getDocument().getElementsByName(“Add_member[]”)[index
of control].checked = true;

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:47 AM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] Tricky
checkbox selection



 

Unfortunately I do not know the value
beforehand.

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Monday, January 23, 2006
10:45 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Tricky
checkbox selection

Do you know the value of the checkbox
beforehand? If you do then just use this method:

 

Ie_browser.checkbox(:name,
“Add_member[]”, “35”).set(); 

 

This should be good to go.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:23 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Tricky
checkbox selection



 

Hello,


I have
following html code and like to select the checkbox for "Test3". How
can I do that? 

 Test1
Subscriber208 

Test2
Subscriber208 
 Test3
Subscriber208 

 

Thanks.







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

Re: [Wtr-general] Tricky checkbox selection

Title: Tricky checkbox selection








Do you know the value of the checkbox beforehand?
If you do then just use this method:

 

Ie_browser.checkbox(:name, “Add_member[]”,
“35”).set(); 

 

This should be good to go.

 

Sergio

 









From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Paatsch, Bernd
Sent: Monday, January 23, 2006
10:23 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Tricky
checkbox selection



 

Hello,


I
have following html code and like to select the checkbox for "Test3".
How can I do that? 

 Test1
Subscriber208 
 Test2
Subscriber208 
 Test3
Subscriber208 

 

Thanks.







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

Re: [Wtr-general] How is it possible to specify to look foraspec ifictext in a sp ecific tag?

Title: How is it possible to specify to look for a specific text in a specific
tag?








So if you have the control reference
already then what you would do is:

 

control_text = ie_browser.[control
reference].text;

 

if  (control_text.index([text you are
looking for]) != nil)

    The text is in the control.

else

    The text is not in the control

end

 

Should be good with that.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Friday, January 20, 2006
4:59 PM
To: 'wtr-general@rubyforge.org'
Subject: Re: [Wtr-general] How is
it possible to specify to look foraspec ifictext in a sp ecific tag?



 

Could you give me an example? I am fairly
new to web testing.

Thanks.

 







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon
Sent: Friday, January 20, 2006
4:29 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] How is
it possible to specify to look for aspecifictext in a sp ecific tag?

And actually an even easier way would be
to get the Text property of the control and then do a check that way as well.
There are several options that you have available.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Friday, January 20, 2006
3:58 PM
To: 'wtr-general@rubyforge.org'
Subject: [Wtr-general] How is it
possible to specify to look for a specifictext in a sp ecific tag?



 

I
am fairly new to watir and think it is a great tool. 

I
have following code that fails to execute. 

 if
ie.contains_text(:id, "current" :text, "Groups")

   
puts "Login Failed!: " 
  
else 
 
puts "Login Passed!" 

 

How
is it possible to specify to look for a specific text in a specific tag?


Thanks,

Bernd







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

Re: [Wtr-general] How to click a button that has no id or name attribute

Title: How to click a button that has no id or name attribute








You can just click the button by using the
value attribute:

 

browser.button(:value, “Login”).click;

 

That should work just fine.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Friday, January 20, 2006
5:02 PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] How to
click a button that has no id or name attribute



 

 




I
have this input button that I like to click. Unfortunate it has not id or name
attribute attached to it. 
How
can I click the button? 

--Bernd


 

***

Bernd
Paatsch 
Software
Quality Assurance Engineer 
Active
Voice LLC 
e-mail:  [EMAIL PROTECTED]

Phone:  (206) 441-4700 x1026


 






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

Re: [Wtr-general] How is it possible to specify to look for a specifictext in a sp ecific tag?

Title: How is it possible to specify to look for a specific text in a specific
tag?








And actually an even easier way would be
to get the Text property of the control and then do a check that way as well.
There are several options that you have available.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Friday, January 20, 2006
3:58 PM
To: 'wtr-general@rubyforge.org'
Subject: [Wtr-general] How is it
possible to specify to look for a specifictext in a sp ecific tag?



 

I
am fairly new to watir and think it is a great tool. 

I
have following code that fails to execute. 

 if
ie.contains_text(:id, "current" :text, "Groups")

   
puts "Login Failed!: " 
  
else 
 
puts "Login Passed!" 

 

How
is it possible to specify to look for a specific text in a specific tag?


Thanks,

Bernd







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

Re: [Wtr-general] How is it possible to specify to look for a specifictext in a sp ecific tag?

Title: How is it possible to specify to look for a specific text in a specific
tag?








It’s acutally quite simple. You can
get the object like you would normally then use the ole object and then check
the innerHTML or innerText since at that point you are just using the IE DOM
you can basically do anything you would from _javascript_ in IE.

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paatsch, Bernd
Sent: Friday, January 20, 2006
3:58 PM
To: 'wtr-general@rubyforge.org'
Subject: [Wtr-general] How is it
possible to specify to look for a specifictext in a sp ecific tag?



 

I
am fairly new to watir and think it is a great tool. 

I
have following code that fails to execute. 

 if
ie.contains_text(:id, "current" :text, "Groups")

   
puts "Login Failed!: " 
  
else 
 
puts "Login Passed!" 

 

How
is it possible to specify to look for a specific text in a specific tag?


Thanks,

Bernd







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

Re: [Wtr-general] How to Have Watir Run Unattended?

Title: How to Have Watir Run Unattended?








I know this may be a little bit of extra
work but here is what we do and it works fine.

 

We use CruiseControl.Net which is a
service that runs on our build machine and runs at timed intervals or we can force
it as well. But then from CruiseControl we have a Nant build kickoff that
executes our build scripts which one of the things that is done in that is to
execute our WATIR scripts.

 

Hope this helps. But as you can see it can
be done and with minimal setup really. CruiseControl and Nant are both very
easy to setup and get running.

 

Sergio









From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Gordon, John
Sent: Friday, January 20, 2006
2:30 PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] How to Have
Watir Run Unattended?



 

Hi
all,

Does
anyone know how to set up Watir to run unattended?  I’m having
troubles trying to do this using a Scheduled Task.

Requirements:

1)
Execute a Watir script without having to have a user login to the computer to
execute it (e.g via a Service or Scheduled task).

2)
Have the script notify the developers when testing fails (via email or updating
a web page).

I’m
trying to set up a Watir script to serve as a  “heart
beat” of sorts for my web site.  The idea is that I have a watir
script constantly running that tests a website and notifies our
development team (via email or a status web page) when the scripts fail. 
I thought I would do it by creating a Windows Scheduled task that would
periodically call my Watir Script.  I’m getting an error when I
execute
this scheduled task, however.  The error is:

Failed to create WIN32OLE object from
`InternetExplorer.Application'

    HRESULT error code:0x80070005

  Access is denied.

The
script runs fine when I execute it via a command prompt.  The user the
Scheduled Task is running under is an admin account, so that should be fine
too.  The only thing I’m doing in the script is calling IE.new();
that’s where the error occurs. I’m wondering if the problem is due
to IE being a GUI app and scheduled tasks don’t display
GUI’s.  I tested this by creating a Scheduled Task to simply
instantiate an instance of IE; it worked without errors.

Here’s
the test I’m running:

require 'watir'

require 'test/unit'

require 'ftools'

class TC_MyCompany < Test::Unit::TestCase

include Watir

 

def test_hello_world

@ie = IE.new() #BOOM!! Error happens here.

@ie.close()

t = Time.now 

time_stamp = t.strftime("Printed on %m/%d/%Y at
%I:%M%p") 

File.open('E:\Watir\hello.txt', "w+") { |msg_file|

   msg_file.write("successfully
opened IE at #{time_stamp}")

    }

rescue

 File.open('E:\Watir\hello.txt', "w+") {
|msg_file|

   msg_file.write($!)

    }

end

    

end

 

Thanks for any help you can offer!

 

John






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

Re: [Wtr-general] Variable Number and Type of Method Parameters?









I don’t understand. You’re
saying that WATIR uses REXML to allow Xpath expressions against the IE DOM?

 

Sergio

 









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Angrez Singh
Sent: Friday, January 20, 2006
10:56 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general]
Variable Number and Type of Method Parameters?



 

Hi Sergio,

The XPath extension internally uses REXML only to find the elements in IE DOM. 

Regards,
Angrez



On 1/20/06, Sergio
Pinon < [EMAIL PROTECTED]>
wrote:

Not sure if you guys
realize it but there is an xml library available in Ruby called REXML and from
there you can use it in your WATIR scripts. I don't know if you saw my last
post but I had written a small testing framework on top of Ruby and WATIR that
utilizes REXML so that I can store my controls in an XML file and reference
them from there. If you get a chance you might want to take a look to see how
you can use the REXML library. 

Sergio



From: [EMAIL PROTECTED]
on behalf of Angrez Singh
Sent: Fri 1/20/2006 12:35 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters?


Hi,

I think XPath extenstion to WATiR would be helpful in this case. Please
download the tar ball from HEAD and read the supporting document in the 'docs'
directory. 

Regards,
Angrez


On 1/20/06, Andrew McFarlane <[EMAIL PROTECTED]>
wrote:

I am testing an application
whose UI controls are often difficult to 
specify.  Sometimes I
can uniquely identify a control with one attribute,
and sometimes I need 3 or
4.  Sometimes I can't see the difference between
multiple controls, so I need to
use an index value as one of those 3 or 4 
attributes.  With
WATIR, can I specify a control by using a variable number
and kind of parameters?

I have a
watered-down-not-thread-safe-has-synchronization-problems Perl tool
  (that I would like
to toss) emulated from WATIR where I can say: 

$browser->link( innerText
=> 'Modify', nameProp =>
qr(modifyProductContract),
outerHTML => qr((Pro|Select|Value) Service),
index => 4 )->click;

I see that I can use regex's
with WATIR (very good), so I just need to make 
sure that I can pass in any
number of control attributes and values before I
embrace WATIR.

If I can, how do I do
it?  A hash?  Something else?

Thanks.

Andrew McFarlane 


___
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] Variable Number and Type of Method Parameters?

Not sure if you guys realize it but there is an xml library available in Ruby 
called REXML and from there you can use it in your WATIR scripts. I don't know 
if you saw my last post but I had written a small testing framework on top of 
Ruby and WATIR that utilizes REXML so that I can store my controls in an XML 
file and reference them from there. If you get a chance you might want to take 
a look to see how you can use the REXML library. 
 
Sergio



From: [EMAIL PROTECTED] on behalf of Angrez Singh
Sent: Fri 1/20/2006 12:35 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Variable Number and Type of Method Parameters?


Hi,

I think XPath extenstion to WATiR would be helpful in this case. Please 
download the tar ball from HEAD and read the supporting document in the 'docs' 
directory.

Regards,
Angrez


On 1/20/06, Andrew McFarlane <[EMAIL PROTECTED]> wrote: 

I am testing an application whose UI controls are often difficult to
specify.  Sometimes I can uniquely identify a control with one 
attribute,
and sometimes I need 3 or 4.  Sometimes I can't see the difference 
between 
multiple controls, so I need to use an index value as one of those 3 or 
4
attributes.  With WATIR, can I specify a control by using a variable 
number
and kind of parameters?

I have a watered-down-not-thread-safe-has-synchronization-problems Perl 
tool 
  (that I would like to toss) emulated from WATIR where I can say:

$browser->link( innerText => 'Modify', nameProp =>
qr(modifyProductContract), outerHTML => qr((Pro|Select|Value) Service),
index => 4 )->click; 

I see that I can use regex's with WATIR (very good), so I just need to 
make
sure that I can pass in any number of control attributes and values 
before I
embrace WATIR.

If I can, how do I do it?  A hash?  Something else? 

Thanks.

Andrew McFarlane


___
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] A testing framework

In regards to your first question I think the thought process behind
that design was that I wanted something robust enough to be able to
handle any web testing. I didn't want to have to write if statements for
each control on each page so after researching I figured the easiest way
would be to write libraries for each control type and then within those
libraries handle every event that could be raised for each object type.
Basically those are the core elements I felt that were needed to run a
test.

Secondly, for CruiseControl, all you need to do I smodify the config
files to include your xsl files and then write your xsl files to be able
to parse your xml and create the output. It was actually quite simple.

Sergio
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon
Sent: Monday, January 16, 2006 1:11 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] A testing framework

Hi Sergio

> I recently spent sometime coming up with a simpler way to test my
projects
> running from nant and using xml as the test. I would love to get some
> feedback on what ones think or ways that it can be improved. I have
attached
> the entire framework for your review.

At a glance, I can see what you're doing here.  (Although I'm sure I
fail to grasp the finer points from such a quick look.)   If you don't
mind a couple of questions...

Your XML tests seem to contain 3 elements, control_type,
control_object, and control_action, of which some take parameters. 
What drove these design decisions?  That is, it seems efficient and
useful in context, I wonder the process by which you arrived at this
design.

Also, I'm about to have to integrate some Ruby (not Watir) tests with
CC.NET, and it would be great to hear what you had to do to get your
Ruby code to interact nicely with CruiseControl.

Thanks...
-Chris

___
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] Testing framework









Also I forgot to submit the xsl files I used for
CruiseControl.NET to display the results.

 

 

Sergio Piñon
Senior Software Engineer

Information Technology Department
G4S Justice Services Inc.

30201 Aventura

Rancho Santa
  Margarita, CA 92688

Tel: (949) 635-1600 x325

Fax: (949) 635-1614
[EMAIL PROTECTED]



 





This company is part of the Group 4 Securicor group of
companies. This communication contains information which may be confidential,
personal and/or privileged. It is for the exclusive use of the intended
recipient(s). If you are not the intended recipient(s), please note that any
distribution, forwarding, copying or use of this communication or the
information in it is strictly prohibited. Any personal views expressed in this
e-mail are those of the individual sender and the Company does not endorse or
accept responsibility for them. Prior to taking any action based upon this
e-mail message, you should seek appropriate confirmation of its authenticity.
This message has been checked for viruses on behalf of the Company.



 








rubysummary.xsl
Description: rubysummary.xsl


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