[wtr-general] Re: WatirCraft LLC is closing

2009-06-03 Thread Wesley Chen
Sorry to hear that.
All of us will be appreciated to you and expect you will have nice life in
Canvio!

Thanks.
Wesley Chen.


On Thu, Jun 4, 2009 at 12:23 PM, Maura van der Linden <
mauravanderlin...@gmail.com> wrote:

>
> Sorry to hear about WatirCraft LLC closing but good travels in your new
> challenges at Convio!
>
> - Maura
>
>
> On 6/3/09 8:45 PM, "Bret Pettichord"  wrote:
>
> >
> > Pete Dignan and I have decided to shut down WatirCraft LLC.
> >
> >
> Maura van der Linden
> Mythos Manor, LLC
> http://www.mauravanderlinden.com
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Towards migrating to Watir.com

2009-06-03 Thread Alister Scott

  Hi Everyone,
  I have looked into many options and can't find a free/cheap
  option to host Confluence for watir.com. Amazon EC2 will be at
  least US$80 per month (~$1000 per year) so we would need to find
  a sponsor for this. On top of this, we would need to configure
  and maintain (backup) Confluence ourselves which is additional
  effort.

  In moving forward I have asked why we are wanting to do what
  we're doing. I understand there are two main reasons:
  1) The current site (http://wtr.rubyforge.org/) is old, hard to
  update by multiple people, and not very dynamic, meaning the
  information on here is often not up to date.
  2) It is believed the openqa.org site is taking on a more
  selenium focus and therefore Watir might be better hosted
  elsewhere (dedicated instance).

  One solution I propose is that we use wordpress.com as a CMS to
  host watir.com (custom domain name mapping costs $10USD per
  year) and besides this there is no charge for up to 3GB content
  and unlimited traffic.

  The benefit of using wordpress.com is that it is very fast, has
  a high google pagerank, is very easy to configure and use, and
  allows multiple authors for the site.

  I have set a very quick demo here:
  http://watirweb.wordpress.com/ The great thing is that the site
  has RSS feeds, and using the widgets we can display various
  content dynamically.

  This solves issue 1 above, but the issue 2 still exists.

  I personally think issue 2 has died down a bit of late, and that
  we could possibly continue using openqa.org for the wiki and
  JIRA for the immediate future, until something changes. We can
  just link to this site from watir.com

  I look forward to hearing your ideas and feedback about this.

  Cheers,
  Alister

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: WatirCraft LLC is closing

2009-06-03 Thread Maura van der Linden

Sorry to hear about WatirCraft LLC closing but good travels in your new
challenges at Convio!

- Maura


On 6/3/09 8:45 PM, "Bret Pettichord"  wrote:

> 
> Pete Dignan and I have decided to shut down WatirCraft LLC.
> 
> 
Maura van der Linden
Mythos Manor, LLC
http://www.mauravanderlinden.com




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: WatirCraft LLC is closing

2009-06-03 Thread Alister Scott

Sorry to hear about WatirCraft LLC.
Good news about finding what sounds like an interesting position at
Convio.
I look forward to hearing about how Rasta is being utilised.

Cheers,
Alister Scott
Brisbane, Australia
Blog: http://watirmelon.wordpress.com
Twitter: http://twitter.com/alisterscott
Google: http://www.google.com/profiles/alister.scott
LinkedIn: http://www.linkedin.com/in/alisterscott


On Jun 4, 1:45 pm, Bret Pettichord  wrote:
> Pete Dignan and I have decided to shut down WatirCraft LLC.
>
> I will begin working full time for Convio in July. Convio has made a big
> commitment to using Watir. I will continue to be involved in the Watir
> community, but Convio is a software company that uses Watir internally
> to test its software -- just like many of you. Convio has not made any
> commitment to sponsor contributions to Watir, except when they also
> serve their internal needs. I'm actually looking forward to going back
> to being mainly a tester, instead of a framework developer.
>
> It will take some time to figure out what this transition will mean for
> my involvement with Watir. For one, it means we will need more help
> running the Watir project. Getting the Watir 1.7 release out has been
> delayed due to this transition (and a sprained knee), but all that is
> behind me now, so that should be able to move out shortly.
>
> Some people have asked about the WatirCraft framework. Convio currently
> uses the Rasta framework, and I expect to get more involved with that
> framework, which Hugh McGowan (at Convio) has been working on quite
> diligently lately. Some time ago, I sketched out a plan to integrate
> Rasta into WatirCraft. I expect to take a second look at those plans.
>
> The WatirCraft framework itself is open-source and will continue to be
> hosted on Github and available for use.
>
> Bret
>
> --
> Bret Pettichord
> CTO, WatirCraft LLC,www.watircraft.com
> Lead Developer, Watir,www.watir.com
> Blog,www.io.com/~wazmo/blog
> Twitter,www.twitter.com/bpettichord
>
> Ask me about Watir trainingwww.watircraft.com/training
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] WatirCraft LLC is closing

2009-06-03 Thread Bret Pettichord

Pete Dignan and I have decided to shut down WatirCraft LLC.

I will begin working full time for Convio in July. Convio has made a big 
commitment to using Watir. I will continue to be involved in the Watir 
community, but Convio is a software company that uses Watir internally 
to test its software -- just like many of you. Convio has not made any 
commitment to sponsor contributions to Watir, except when they also 
serve their internal needs. I'm actually looking forward to going back 
to being mainly a tester, instead of a framework developer.

It will take some time to figure out what this transition will mean for 
my involvement with Watir. For one, it means we will need more help 
running the Watir project. Getting the Watir 1.7 release out has been 
delayed due to this transition (and a sprained knee), but all that is 
behind me now, so that should be able to move out shortly.

Some people have asked about the WatirCraft framework. Convio currently 
uses the Rasta framework, and I expect to get more involved with that 
framework, which Hugh McGowan (at Convio) has been working on quite 
diligently lately. Some time ago, I sketched out a plan to integrate 
Rasta into WatirCraft. I expect to take a second look at those plans.

The WatirCraft framework itself is open-source and will continue to be 
hosted on Github and available for use.

Bret

-- 
Bret Pettichord
CTO, WatirCraft LLC, www.watircraft.com
Lead Developer, Watir, www.watir.com
Blog, www.io.com/~wazmo/blog
Twitter, www.twitter.com/bpettichord

Ask me about Watir training
www.watircraft.com/training


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Unable to click an element in table/grid

2009-06-03 Thread Ray

I am trying to click a cell in the table

On Jun 3, 5:08 pm, George  wrote:
> Are you trying to click a particular row in the result table or a cell
> containing a hyperlink?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Unable to click an element in table/grid

2009-06-03 Thread George

Are you trying to click a particular row in the result table or a cell
containing a hyperlink?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] What is equivalent to ie.childBrowser() used in Watij?

2009-06-03 Thread yurock

Hi everybody!

Maybe the question is a bit strange but nevertheless)

I am trying to work with application using Watir. Before this my
colleague worked a bit with the same application using Watij. And he
found out that it is necessary to use such code:

IE ie=new IE();
ie.start("http://link.com";);
IE new_ie = ie.childBrowser();

i.e. it is necessary to work with child brower, in other case nothing
works.

The question is what is the equivalent of "ie.childBrowser()" in Ruby/
Watir?

p.s. Child browser in my application does not look like new window.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Unable to click an element in table/grid

2009-06-03 Thread Ray

Hi

Did you ever figure out the problem with this? I am having a similar
problem. For me the click works in Fire Fox(using fire watir) but when
i try the same thing in IE nothing happens and the script ends without
errors.

any help is appreciated

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread Chuck van der Linden

I can appreciate (and I presume the users will also) the effort to
keep the page lightweight.  "running light, without overbyte" as Dr.
Dobbs used to say.

but perhaps you could see if  they could add the minimun needed to
make it more testable without a lot of extra overhead (e.g. going nuts
with divs tables etc)

a few bytes of 'name=' here and there on some link and radio
buttons isn't going to noticiably affect the speed, the overhad there
is super light, and shouldn't really affect render time that much
either.. (I'd doubt the effect would exceed the margin of error and/or
repeatability in trying to measure it)

not like I expect dev to solve all your test automation issues for
you, but hey it is a partnership, so it's not unreasonable imho to ask
for a bone now and then.

On Jun 3, 12:29 pm, James  wrote:
> Thanks Chuck.  In this case, each link is to a different URL, but
> whether I want to click there in my test is determined by whether some
> text is located immediately above it.  Normally the devs do a great
> job of putting names and ids on every little piece, but as this is for
> mobile browsers (like the blackberry), they've kept it as simple as
> possible so that all browsers could read it and it would download
> quickly.  It probably wouldn't hurt for them to add some things like
> names and ids, but then they'd have to put in tables, divs, etc.,
> which they are hesitant to do as they are trying to keep things as
> absolutely simple as possible.
>
> The advice above is helping me, although I'm having some issues using
> the "after?" how, as I mentioned in a new thread I just opened up.  It
> seems to work for me with certain kinds of elements, but not others.
>
> I'm going to keep hacking away at it for a bit, but in the end I may
> just give up on it.  It may just not be worth automating the testing
> on this.
>
> Thanks again,
> James
>
> On Jun 3, 3:23 pm, Chuck van der Linden  wrote:
>
>
>
> > unless my HTML is really rusty, 'b' tags are for boldface.    normally
> > I'd try looking the next container up.  but in this case it would
> > appear that whatever that container is (we can't tell from the
> > fragment you gave us) there's more text in there than that.. including
> > text in other  tags
>
> > You might end up having to learn a bit about regular expressions to
> > tackle this one.
>
> > I'm guessing you can't predict the URL for that link, or you'd be
> > identifying it that way right?  and that unlike your examples the URL
> > for each link is in fact different (otherwise, clicking one is as good
> > as clicking another)
>
> > man too bad they didn't stick those things into a table or something,
> > that would make your life a lot easier.
>
> > is 'testability' a requirement for the site you are testing against?
> > if so maybe you could persuade the devs to make a few changes that
> > would make it easier to automate?  like oh  a 'Name' attribute for the
> > link that is the same as the nearby text that identifies it visually
>
> > On Jun 3, 9:38 am, James  wrote:
>
> > > Thanks Darin - that's really helpful!  Now I just need to know how to
> > > latch onto the text surrounded by the .  Any ideas?  If that
> > > works, then I can definitely use the "after?" method to grab the link
> > > after it.
>
> > > (I'm still looking at xpath, but I've never used xpath before and am
> > > finding it quite confusing!)
>
> > > Thanks,
> > > James
>
> > > On Jun 3, 12:27 pm, "Darin Duphorn" 
> > > wrote:
>
> > > > Below is code that gets the div that appears after a label, this might 
> > > > also help.
>
> > > > label_id = $ie.div(:after?, $ie.label(:text,'Home')).span(:index,1)  
>
> > > > -Original Message-
> > > > From: watir-general@googlegroups.com 
> > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > Sent: Wednesday, June 03, 2009 11:24 AM
> > > > To: Watir General
> > > > Subject: [wtr-general] Re: Finding a specific instance of a repeated 
> > > > link via text surrounding it.
>
> > > > It's more like I just want to grab an element based on where it is in
> > > > reference to another element, or in reference to text on the page.
>
> > > > I noticed Charley's mention of xpath and am looking into it right now
> > > > - I think it might be what I'm looking for, unless someone has another
> > > > suggestion.
>
> > > > James
>
> > > > On Jun 3, 12:21 pm, "Darin Duphorn" 
> > > > wrote:
> > > > > Ok, you want to us the information in the  tag to determine what 
> > > > > link to click.
>
> > > > > But the  isn't a supported tag, so you don't know how to use it.
>
> > > > > Is this a correct?
>
> > > > > -Original Message-
> > > > > From: watir-general@googlegroups.com 
> > > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > > Sent: Wednesday, June 03, 2009 11:17 AM
> > > > > To: Watir General
> > > > > Subject: [wtr-general] Re: Finding a specific instance of a repeated 
> > > > > link via text surrounding it.
>
> > > > > But

[wtr-general] Re: pls help; Enter data in textbox

2009-06-03 Thread Chuck van der Linden

>>I used set focus method but still it has a problem.

and the problem is?   what happens when you try to run the code?  do
you get an error?  if so what is the message.

knowing the nature of the failure is paramount to troubleshooting the
problem.

On Jun 2, 11:34 pm, "KiranD"  wrote:
> Hi Guys
>
> I am trying to enter some text in the textbox through Watir ,
>
> but it is not able to enter text directly in the textbox until I click on
> web page area.
>
> When I click on any where on the page area then it shows description string
> in Textbox.
>
> I used set focus method but still it has a problem.
>
> I have to data driven testing.  help me to resolve this
>
> Here is the piece of code that I used.
>
> ie.bring_to_front()
>
> ie.text_field(:id,"short_desc").focus()
>
> ie.text_field(:id,"short_desc").set "Description"
>
> 
>
>             Description: 
>
>             
>
>                
>
>             
>
>              size="100" maxlength="200" />
>
>                
>
>              
>
> Best regards,
>
> KiranD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to detect the a mouseover popup?

2009-06-03 Thread Chuck van der Linden

Are you talking about something that is dynamically rendered in the UI
when an element experiences a mouseover?

You'd need to be able to determine what properties of the dynamic
element you could look for, like a visibility style.

Once you know that,  fire the 'onMouseOver' event at the elementA that
should be reacting to the mouseover event, allow a tiny bit of time
for elementB it to render (might sleep for a half second or something)
and check for the resulting style change on the elementB that would be
causing it to be displayed.

not sure if that's foolproof or not, potentially whatever reacts to
the style change could be failing to work and you'd not detect it (I
think)  but it's about the closest I've found.

On Jun 3, 1:38 am, Ivan Chung  wrote:
> I just need a value returned, lets say the popup works then return
> "true" and vice versa.
>
> On Jun 3, 4:36 pm, Ivan Chung  wrote:
>
>
>
> > Hi all,
>
> > I have scenario which i needed to detect the presence of a javascript
> > popup when mouse over the navigations. How could i do this?
>
> > Any helps are appreciated.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: example problem

2009-06-03 Thread Chuck van der Linden

I defer to Bret and others who know the code better than I.. but
differences like this after the integration effort surprise me.
What's the value in all the work to integrate the two if something as
simple as trying to identify something by it's list position (I
presume for example that TR would suffer from this?)  will cause
automation code to be non portable between the two browsers.

On Jun 3, 4:13 am, aidy lewis  wrote:
> Chuck,
>
> Your comments are highly simplistic: We still have differences with
> list based indexes; Watir being one based and Firewatir zero based
> (as Watir wraps OLE and FireWatir, javascipt), the text representation
> of the HTML (browser.text), #click_no_wait, and to my knowledge
> parallelism.
>
> Aidy
>
> 2009/6/2 Chuck van der Linden :
>
>
>
>
>
>
>
> > To be more clear, the current version of Watir has integrated in the
> > Firewatir driver..  so you get both Watir and Firewatir when you
> > install it.
>
> > Most functions are pretty much equally supported on both browsers.
> > and the way things work you now institute an instance of 'browser'
> > which can be either IE or FF, and call most of your methods against
> > that.
> >  (seehttp://wiki.openqa.org/display/WTR/Browser.new)
>
> > The nice thing is that now I have scripts that do things like:
> > browser.link(:text, "clickme").click   and they can be developed
> > against either IE or FireFox, and then quickly switched (via a few
> > different methods depending on what works best for you) to run against
> > the other browser.
>
> > not all of the tutorial and sample code has caught up to the new
> > paradigm, so you will see a lot of code there, and also posted here,
> > where people will write 'ie.method..'  and 'ff.method...'    but now
> > adays we'd typically say 'browser.method' (and some will shorten that
> > to bro.method, or br, or just b  (although there's a bit of a
> > preference style wise among ruby programmers to only use single letter
> > variables for iterators) )
>
> > Hopefully that eliminates a bit of the confusion instead of just
> > causing more.
>
> > On May 30, 10:55 pm, James  wrote:
> >> ok completely new to the world of ruby as well as programming
> >>       The final goal is too scrape an ajax site... if I understand
> >> currently I need both watir and firewatir?
> >> I am trying to go through some online examples and am trying to
> >> complete the google_search.rb example that seems to be floating
> >> around.
>
> >> I don't think the program is running properly when I  
> >> require "watir"
> >>      because I get the error      google_search.rb:14:in
> >> `require': no such file to load -- watir (LoadError)
>
> >> any idea what this means? I am running windows xp
>
> >> thanks for the help in advance
>
> --
> Aidy
> blog:www.agiletester.co.uk
> twitter:http://twitter.com/aidy_lewis- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: request for radio button giving me arguments error

2009-06-03 Thread Chuck van der Linden

There's nothing else you could use to idenfity the correct radio
button?  such as say it's value?

sample html might be useful in assisting you

On Jun 3, 12:16 pm, James  wrote:
> I've played around some more and it seems that "link" is the only
> element type that will work for me - button, text_field, and radio all
> fail with the same error.
>
> On Jun 3, 3:14 pm, James  wrote:
>
>
>
> > If I have this:
>
> > browser.link(:after?, myelement).exists?
>
> > It works.
>
> > However, if I change it to this:
>
> > browser.radio(:after?, myelement).exists?
>
> > I get the error:
> > "ArgumentError: wrong number of arguments (0 for 1)"
>
> > I"m confused - what am I missing?  I have the same number of
> > arguments.  is the "after?" how not supported by radio?  I'm confused
> > on how it would work with one element type but not a different one.- Hide 
> > quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread James

Thanks Chuck.  In this case, each link is to a different URL, but
whether I want to click there in my test is determined by whether some
text is located immediately above it.  Normally the devs do a great
job of putting names and ids on every little piece, but as this is for
mobile browsers (like the blackberry), they've kept it as simple as
possible so that all browsers could read it and it would download
quickly.  It probably wouldn't hurt for them to add some things like
names and ids, but then they'd have to put in tables, divs, etc.,
which they are hesitant to do as they are trying to keep things as
absolutely simple as possible.

The advice above is helping me, although I'm having some issues using
the "after?" how, as I mentioned in a new thread I just opened up.  It
seems to work for me with certain kinds of elements, but not others.

I'm going to keep hacking away at it for a bit, but in the end I may
just give up on it.  It may just not be worth automating the testing
on this.

Thanks again,
James

On Jun 3, 3:23 pm, Chuck van der Linden  wrote:
> unless my HTML is really rusty, 'b' tags are for boldface.    normally
> I'd try looking the next container up.  but in this case it would
> appear that whatever that container is (we can't tell from the
> fragment you gave us) there's more text in there than that.. including
> text in other  tags
>
> You might end up having to learn a bit about regular expressions to
> tackle this one.
>
> I'm guessing you can't predict the URL for that link, or you'd be
> identifying it that way right?  and that unlike your examples the URL
> for each link is in fact different (otherwise, clicking one is as good
> as clicking another)
>
> man too bad they didn't stick those things into a table or something,
> that would make your life a lot easier.
>
> is 'testability' a requirement for the site you are testing against?
> if so maybe you could persuade the devs to make a few changes that
> would make it easier to automate?  like oh  a 'Name' attribute for the
> link that is the same as the nearby text that identifies it visually
>
> On Jun 3, 9:38 am, James  wrote:
>
> > Thanks Darin - that's really helpful!  Now I just need to know how to
> > latch onto the text surrounded by the .  Any ideas?  If that
> > works, then I can definitely use the "after?" method to grab the link
> > after it.
>
> > (I'm still looking at xpath, but I've never used xpath before and am
> > finding it quite confusing!)
>
> > Thanks,
> > James
>
> > On Jun 3, 12:27 pm, "Darin Duphorn" 
> > wrote:
>
> > > Below is code that gets the div that appears after a label, this might 
> > > also help.
>
> > > label_id = $ie.div(:after?, $ie.label(:text,'Home')).span(:index,1)  
>
> > > -Original Message-
> > > From: watir-general@googlegroups.com 
> > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > Sent: Wednesday, June 03, 2009 11:24 AM
> > > To: Watir General
> > > Subject: [wtr-general] Re: Finding a specific instance of a repeated link 
> > > via text surrounding it.
>
> > > It's more like I just want to grab an element based on where it is in
> > > reference to another element, or in reference to text on the page.
>
> > > I noticed Charley's mention of xpath and am looking into it right now
> > > - I think it might be what I'm looking for, unless someone has another
> > > suggestion.
>
> > > James
>
> > > On Jun 3, 12:21 pm, "Darin Duphorn" 
> > > wrote:
> > > > Ok, you want to us the information in the  tag to determine what 
> > > > link to click.
>
> > > > But the  isn't a supported tag, so you don't know how to use it.
>
> > > > Is this a correct?
>
> > > > -Original Message-
> > > > From: watir-general@googlegroups.com 
> > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > Sent: Wednesday, June 03, 2009 11:17 AM
> > > > To: Watir General
> > > > Subject: [wtr-general] Re: Finding a specific instance of a repeated 
> > > > link via text surrounding it.
>
> > > > But the text I'm referring to isn't part of the link itself.  The link
> > > > text is the same.  I'm looking at the text that occurs -before- (or
> > > > possibly after) the link.
>
> > > > Thanks for your suggestions, but unfortunately, in this example, it
> > > > won't work.
>
> > > > James
>
> > > > On Jun 3, 12:13 pm, Charley Baker  wrote:
> > > > > Could also use multiple attributes:
>
> > > > > browser.link(:index => 1, :text => /Click This Link/).click
>
> > > > > or xpath.
>
> > > > > Charley Baker
> > > > > blog:http://blog.charleybaker.org/
> > > > > Lead Developer, Watir,http://wtr.rubyforge.org
> > > > > QA Architect, Gap Inc Direct
>
> > > > > On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> > > > > wrote:
>
> > > > > > Browser.link(:text,/Click This Link/).click
>
> > > > > > -Original Message-
> > > > > > From: watir-general@googlegroups.com
> > > > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > > > Sent: Wednesday, June 03, 2009 11

[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread Chuck van der Linden

unless my HTML is really rusty, 'b' tags are for boldface.normally
I'd try looking the next container up.  but in this case it would
appear that whatever that container is (we can't tell from the
fragment you gave us) there's more text in there than that.. including
text in other  tags

You might end up having to learn a bit about regular expressions to
tackle this one.

I'm guessing you can't predict the URL for that link, or you'd be
identifying it that way right?  and that unlike your examples the URL
for each link is in fact different (otherwise, clicking one is as good
as clicking another)

man too bad they didn't stick those things into a table or something,
that would make your life a lot easier.

is 'testability' a requirement for the site you are testing against?
if so maybe you could persuade the devs to make a few changes that
would make it easier to automate?  like oh  a 'Name' attribute for the
link that is the same as the nearby text that identifies it visually

On Jun 3, 9:38 am, James  wrote:
> Thanks Darin - that's really helpful!  Now I just need to know how to
> latch onto the text surrounded by the .  Any ideas?  If that
> works, then I can definitely use the "after?" method to grab the link
> after it.
>
> (I'm still looking at xpath, but I've never used xpath before and am
> finding it quite confusing!)
>
> Thanks,
> James
>
> On Jun 3, 12:27 pm, "Darin Duphorn" 
> wrote:
>
>
>
> > Below is code that gets the div that appears after a label, this might also 
> > help.
>
> > label_id = $ie.div(:after?, $ie.label(:text,'Home')).span(:index,1)  
>
> > -Original Message-
> > From: watir-general@googlegroups.com 
> > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > Sent: Wednesday, June 03, 2009 11:24 AM
> > To: Watir General
> > Subject: [wtr-general] Re: Finding a specific instance of a repeated link 
> > via text surrounding it.
>
> > It's more like I just want to grab an element based on where it is in
> > reference to another element, or in reference to text on the page.
>
> > I noticed Charley's mention of xpath and am looking into it right now
> > - I think it might be what I'm looking for, unless someone has another
> > suggestion.
>
> > James
>
> > On Jun 3, 12:21 pm, "Darin Duphorn" 
> > wrote:
> > > Ok, you want to us the information in the  tag to determine what link 
> > > to click.
>
> > > But the  isn't a supported tag, so you don't know how to use it.
>
> > > Is this a correct?
>
> > > -Original Message-
> > > From: watir-general@googlegroups.com 
> > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > Sent: Wednesday, June 03, 2009 11:17 AM
> > > To: Watir General
> > > Subject: [wtr-general] Re: Finding a specific instance of a repeated link 
> > > via text surrounding it.
>
> > > But the text I'm referring to isn't part of the link itself.  The link
> > > text is the same.  I'm looking at the text that occurs -before- (or
> > > possibly after) the link.
>
> > > Thanks for your suggestions, but unfortunately, in this example, it
> > > won't work.
>
> > > James
>
> > > On Jun 3, 12:13 pm, Charley Baker  wrote:
> > > > Could also use multiple attributes:
>
> > > > browser.link(:index => 1, :text => /Click This Link/).click
>
> > > > or xpath.
>
> > > > Charley Baker
> > > > blog:http://blog.charleybaker.org/
> > > > Lead Developer, Watir,http://wtr.rubyforge.org
> > > > QA Architect, Gap Inc Direct
>
> > > > On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> > > > wrote:
>
> > > > > Browser.link(:text,/Click This Link/).click
>
> > > > > -Original Message-
> > > > > From: watir-general@googlegroups.com
> > > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > > Sent: Wednesday, June 03, 2009 11:08 AM
> > > > > To: Watir General
> > > > > Subject: [wtr-general] Finding a specific instance of a repeated link
> > > > > via text surrounding it.
>
> > > > > I'm trying to figure out how to click on a link, and the only way I
> > > > > know which link to click on is from text that comes before it.
> > > > > Otherwise, it looks the same as other links on the same page.
>
> > > > > So for instance, the html might look like:
>
> > > > > Click This Link
> > > > > 
> > > > > http://clickhere.com";>The Link
> > > > > 
> > > > > But Not this link
> > > > > 
> > > > > http://clickhere.com";>The Link
>
> > > > > I want to be able to read the page and latch onto the link with the
> > > > > "Click This Link" but not other ones.  In fact, if there are multiple
> > > > > "Click This Link" links, I want to be able to find all of them, and
> > > > > ignore the rest.
>
> > > > > I'm at a loss how to do this with Watir.  I'm used to being able to
> > > > > find things by div and id tags, etc., but this is a dumbed down page
> > > > > meant for mobile devices and it lacks almost all of the things I'm
> > > > > used to latching onto.
>
> > > > > Any suggestions?- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~-

[wtr-general] request for radio button giving me arguments error

2009-06-03 Thread James

If I have this:

browser.link(:after?, myelement).exists?

It works.

However, if I change it to this:

browser.radio(:after?, myelement).exists?

I get the error:
"ArgumentError: wrong number of arguments (0 for 1)"

I"m confused - what am I missing?  I have the same number of
arguments.  is the "after?" how not supported by radio?  I'm confused
on how it would work with one element type but not a different one.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: request for radio button giving me arguments error

2009-06-03 Thread James

I've played around some more and it seems that "link" is the only
element type that will work for me - button, text_field, and radio all
fail with the same error.

On Jun 3, 3:14 pm, James  wrote:
> If I have this:
>
> browser.link(:after?, myelement).exists?
>
> It works.
>
> However, if I change it to this:
>
> browser.radio(:after?, myelement).exists?
>
> I get the error:
> "ArgumentError: wrong number of arguments (0 for 1)"
>
> I"m confused - what am I missing?  I have the same number of
> arguments.  is the "after?" how not supported by radio?  I'm confused
> on how it would work with one element type but not a different one.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: element search recursive?

2009-06-03 Thread Chuck van der Linden

Think of a frame as an entirely seperate web-page, embedded within
another web page.  it is such a distinct body that it's really not
practical to think of it as a 'nested container' they way you would a
div, table, or form.

Due to this and other restrictions, many web-devs I know consider
frames to be 'evil' and eschew their use whenever practical.

On Jun 3, 11:44 am, MatchBook  wrote:
> I noticed that sometimes watir searches within its nested containers
> for items, and sometimes it does not.  I would like to know the rules
> by which it decides to do so or not.
>
> For example, I noticed that in an Amazon.com page 'ie.link(:text,
> "Advanced Search")' returned the same link as 'ie.table.link(:text,
> "Advanced Search")' (here, table is a table element), which lead me to
> believe that watir will search sub-containers for the item requested.
>
> But when I was in the gmail web page, "ie.text_fields" returned a
> different set of items than "ie.canvas_frame.text_fields" (here,
> canvas_frame is a frame element), which puzzled me given my experience
> above.
>
> Jeff
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Need help on jssh installation for firefox

2009-06-03 Thread Alex Collins

Chethan,

Could you try the version of the JSSH plug-in available here, please?  
You'll need to download this as a file.
http://github.com/ajcollins/JSSH-XPIs/raw/7dd112a4defb3a61d1f94d9f95a9d4ecaaedb5f7/plugins/jssh-20090517-WINNT.xpi

Also, are you running Firefox with multiple profiles? If so, JSSH  
needs to be installed in the default profile.

Thanks,

Alex


On 3 Jun 2009, at 14:02, Chethan wrote:

>
> Pls Help me out on this Jssh issue.
>
> Thanks,
> Chethan
>
> On Jun 3, 9:54 am, Chethan  wrote:
>> Yes I am admin user for the machine i am using.
>>
>> Here are the steps i followed.
>> 1. browse tohttp://wtr.rubyforge.org/
>> 1. Installed Ruby fromhttp://rubyforge.org.
>> 2. from command prompt entered "gem update --system"
>> 3. then entered "gem install watir"
>> 4. installed firefox add-on Jssh from the wtr.rubyforge.org site
>> 5. run manually C:\Program Files\Mozilla Firefox>firefox.exe -jssh
>> 6 checked for Jssh port by telnet localhost 9997
>>
>> Following error was seen "Connecting To localhost...Could not open
>> connection to the host, on port 9997: C
>> onnect failed"
>>
>> I am using windows XP(sp2) firefox version is 3.0.10 & jssh version  
>> is
>> 0.9
>>
>> Thanks,
>> Chethan
>>
>> On Jun 2, 6:10 pm, Angrez Singh  wrote:
>>
>>> Are you an admin user on your machine? I use Firewatir a lot on my  
>>> machine
>>> (Windows XP SP2) with Firefox 3.0.10) and never faced any problem  
>>> with jssh.
>>
>>> - Angrez
>>
>>> On Tue, Jun 2, 2009 at 6:04 PM, Chethan   
>>> wrote:
>>
 Yes I installed Jssh plug in but if i do telnet localhost 9997 it  
 say
 there is no service running on 9997 port. That is what i  
 described in
 my earlier mails.
>>
 Thanks,
 Chethan
>>
 On Jun 2, 5:30 pm, jason  wrote:
> did you install the jssh firefox plugin???
>>
> On 2 Jun., 14:05, Chethan  wrote:
>>
>> I installed the Firewatir with new method rather then "gem  
>> install
>> firewatir" command, I done that through "gem install watir"  
>> online how
>> the new Watir overview describes.
>>
>> Thanks,
>> Chethan
>>
>> On Jun 2, 3:04 pm, Chethan  wrote:
>>
>>> Hi,
>>
>>> I am using window-Xp(sp2) & my Firefox version is 3.0.10.
>>
>>> Rgds,
>>> Chethan
> >


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: forms in subframes - elements not found

2009-06-03 Thread Chuck van der Linden

Hey I know you want to look for the select_list INSIDE the form,
(perhaps to verify it's in the right 'place' within the dom etc)   but
if the intent is to manipulate the list, and you are able to identify
it by ID value, then as a workaround until this problem is corrected,
why not just leave out the form and look for it inside the frame?

I mean given that you are identifying it by ID and not Name or Class,
there should only be ONE of them on the page if it's proper HTML.

Yes this doesn't let you validate that someone didn't move the thing
outside of the form, or address any other reason you have for wanting
to look for it 'inside' the form (which I understand perfectly, I do
that kind of thing all the time with navigation links within a
specific div etc)  but it might at least let you get around this for
now..  (and beats the heck out of having to setup a windows VM or
something just so you can run the scripts)

It also seems to me like you've got a pretty valid (and thanks to the
public site, easily reproducable) bug here, so you might want to
create a Jira item for it  to see that it gets fixed 

FWIW I think this code should run on either browser with a simple
change of the default browser value

require 'watir'
Watir::Browser.default = 'ie'   #sets browser preference
url = "http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/
jobboerse.aspx"
browser = Watir::Browser.new
browser.goto(url)
browser.frame(:index, 1).form(:name, "lay0803234_src350a").select_list
(:id, "LOV6") .inspect





--Chuck
On Jun 3, 10:25 am, jason  wrote:
> Aidy. thanks for the feedback!!
>
> ff.table(:index, 1).rows[0].html
>
> is the same as
>
> ff.table(:index, 1).row(:index, 1).html
>
> rows[0] refers to the first element of the array as row(:index, 1)
> referers to the location of the first row in the dom using the
> locate_taged_element method.
>
> however - i see you have access to both IE and Firefox. could you
> please please run this code and tel me if you get the same results as
> i do??
>
> This should work for IE and Firefox (watir and firewatir)
>
> url = "http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/
> jobboerse.aspx"
> ff = FireWatir::Firefox.new
> ff.goto(url)
> ff.frame(:index, 1).form(:name, "lay0803234_src350a").inspect
>
> This should only work for IE: (watir only)
>
> url = "http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/
> jobboerse.aspx"
> ff = FireWatir::Firefox.new
> ff.goto(url)
> ff.frame(:index, 1).form(:name, "lay0803234_src350a").select_list(:id,
> "LOV6") .inspect
>
> Thanks a million
>
> On 3 Jun., 17:03, aidy lewis  wrote:
>
>
>
> > Hi Jason
>
> > How then would you explain this?
>
> >  require 'rubygems'
> >  require 'watir'
>
> >  ['watir', 'firewatir'].each { | g | require g }
> >  ie = Watir::IE.new
> >  ff = FireWatir::Firefox.new
> >  [ie, ff].each { |b| b.goto("http://www.google.com";) }
> >  ff.table(:index, 1).rows[0].html
> >  ie.table(:index, 1).rows[0].html
>
> > Aidy
>
> > 2009/6/3 jason :
>
> > > firewatir index for all elements starts and frames starts with 1
> > > index 0 should be the root document (but its not :-( )
> > > so thanks for the thought
> > > jason.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: element search recursive?

2009-06-03 Thread Michael Hwee


Frame object is entirely different entity from $ie.
So, it does not navigate into a frame to find frame objects.
What you finding is expected behavior.



- Original Message 
From: MatchBook 
To: Watir General 
Sent: Wednesday, June 3, 2009 11:44:52 AM
Subject: [wtr-general] element search recursive?



I noticed that sometimes watir searches within its nested containers
for items, and sometimes it does not.  I would like to know the rules
by which it decides to do so or not.

For example, I noticed that in an Amazon.com page 'ie.link(:text,
"Advanced Search")' returned the same link as 'ie.table.link(:text,
"Advanced Search")' (here, table is a table element), which lead me to
believe that watir will search sub-containers for the item requested.

But when I was in the gmail web page, "ie.text_fields" returned a
different set of items than "ie.canvas_frame.text_fields" (here,
canvas_frame is a frame element), which puzzled me given my experience
above.

Jeff

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] element search recursive?

2009-06-03 Thread MatchBook


I noticed that sometimes watir searches within its nested containers
for items, and sometimes it does not.  I would like to know the rules
by which it decides to do so or not.

For example, I noticed that in an Amazon.com page 'ie.link(:text,
"Advanced Search")' returned the same link as 'ie.table.link(:text,
"Advanced Search")' (here, table is a table element), which lead me to
believe that watir will search sub-containers for the item requested.

But when I was in the gmail web page, "ie.text_fields" returned a
different set of items than "ie.canvas_frame.text_fields" (here,
canvas_frame is a frame element), which puzzled me given my experience
above.

Jeff
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: override js confirm FireWatir

2009-06-03 Thread Chuck van der Linden

A  thanks for clearing that up.   makes a lot more sense now

On Jun 3, 2:19 am, aidy lewis  wrote:
> Chuck
>
> 2009/6/2 Chuck van der Linden :
>
>
>
> > Have you reviewed the general info on the types of popups and how to
> > handle them?  http://wiki.openqa.org/display/WTR/Pop+Ups
>
> The aim was to override the js confirm function without using wsh or
> the autoit wrapper that is shown in these examples, which I have
> successfully accomplished in IE using the execScript method.
>
> Aidy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: forms in subframes - elements not found

2009-06-03 Thread jason

Aidy. thanks for the feedback!!

ff.table(:index, 1).rows[0].html

is the same as

ff.table(:index, 1).row(:index, 1).html

rows[0] refers to the first element of the array as row(:index, 1)
referers to the location of the first row in the dom using the
locate_taged_element method.

however - i see you have access to both IE and Firefox. could you
please please run this code and tel me if you get the same results as
i do??

This should work for IE and Firefox (watir and firewatir)

url = "http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/
jobboerse.aspx"
ff = FireWatir::Firefox.new
ff.goto(url)
ff.frame(:index, 1).form(:name, "lay0803234_src350a").inspect

This should only work for IE: (watir only)

url = "http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/
jobboerse.aspx"
ff = FireWatir::Firefox.new
ff.goto(url)
ff.frame(:index, 1).form(:name, "lay0803234_src350a").select_list(:id,
"LOV6") .inspect

Thanks a million





On 3 Jun., 17:03, aidy lewis  wrote:
> Hi Jason
>
> How then would you explain this?
>
>  require 'rubygems'
>  require 'watir'
>
>  ['watir', 'firewatir'].each { | g | require g }
>  ie = Watir::IE.new
>  ff = FireWatir::Firefox.new
>  [ie, ff].each { |b| b.goto("http://www.google.com";) }
>  ff.table(:index, 1).rows[0].html
>  ie.table(:index, 1).rows[0].html
>
> Aidy
>
> 2009/6/3 jason :
>
>
>
> > firewatir index for all elements starts and frames starts with 1
> > index 0 should be the root document (but its not :-( )
> > so thanks for the thought
> > jason.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread James

That worked perfectly!

Thanks Charley and Darin for your amazing help!

James

On Jun 3, 12:51 pm, Charley Baker  wrote:
> Zeljko has a blog entry for extending support to other elements as well. We
> don't currently support , we do support ,  and some other
> "lesser?" tags. Z just answered a question on this yesterday or the day
> before with a link to his blog post, take a look through the group.
>
> Otherwise the basic idea is create watir_ext.rb or whatever you want to name
> it file.
>
> module Watir
>   class B < NonControlElement
>     TAG = 'B'
>   end
> end
>
> require that your file before accessing the b element and all should be
> good:
>
> browser.link(:after?, browser.b(:text, 'Click me')).click
>
> NB: The syntax looks right, but no guarantees if you copy/paste that it's
> dead on. :)
>
> Charley Baker
> blog:http://blog.charleybaker.org/
> Lead Developer, Watir,http://wtr.rubyforge.org
> QA Architect, Gap Inc Direct
>
> On Wed, Jun 3, 2009 at 10:41 AM, Darin Duphorn
> wrote:
>
>
>
> > Navigate to this thread, if you have any question feel free to keep asking.
>
> >http://groups.google.com/group/watir-general/browse_thread/thread/1e4...
>
> > -Original Message-
> > From: watir-general@googlegroups.com [mailto:
> > watir-gene...@googlegroups.com] On Behalf Of James
> > Sent: Wednesday, June 03, 2009 11:39 AM
> > To: Watir General
> > Subject: [wtr-general] Re: Finding a specific instance of a repeated link
> > via text surrounding it.
>
> > Thanks Darin - that's really helpful!  Now I just need to know how to
> > latch onto the text surrounded by the .  Any ideas?  If that
> > works, then I can definitely use the "after?" method to grab the link
> > after it.
>
> > (I'm still looking at xpath, but I've never used xpath before and am
> > finding it quite confusing!)
>
> > Thanks,
> > James
>
> > On Jun 3, 12:27 pm, "Darin Duphorn" 
> > wrote:
> > > Below is code that gets the div that appears after a label, this might
> > also help.
>
> > > label_id = $ie.div(:after?, $ie.label(:text,'Home')).span(:index,1)
>
> > > -Original Message-
> > > From: watir-general@googlegroups.com [mailto:
> > watir-gene...@googlegroups.com] On Behalf Of James
> > > Sent: Wednesday, June 03, 2009 11:24 AM
> > > To: Watir General
> > > Subject: [wtr-general] Re: Finding a specific instance of a repeated link
> > via text surrounding it.
>
> > > It's more like I just want to grab an element based on where it is in
> > > reference to another element, or in reference to text on the page.
>
> > > I noticed Charley's mention of xpath and am looking into it right now
> > > - I think it might be what I'm looking for, unless someone has another
> > > suggestion.
>
> > > James
>
> > > On Jun 3, 12:21 pm, "Darin Duphorn" 
> > > wrote:
> > > > Ok, you want to us the information in the  tag to determine what
> > link to click.
>
> > > > But the  isn't a supported tag, so you don't know how to use it.
>
> > > > Is this a correct?
>
> > > > -Original Message-
> > > > From: watir-general@googlegroups.com [mailto:
> > watir-gene...@googlegroups.com] On Behalf Of James
> > > > Sent: Wednesday, June 03, 2009 11:17 AM
> > > > To: Watir General
> > > > Subject: [wtr-general] Re: Finding a specific instance of a repeated
> > link via text surrounding it.
>
> > > > But the text I'm referring to isn't part of the link itself.  The link
> > > > text is the same.  I'm looking at the text that occurs -before- (or
> > > > possibly after) the link.
>
> > > > Thanks for your suggestions, but unfortunately, in this example, it
> > > > won't work.
>
> > > > James
>
> > > > On Jun 3, 12:13 pm, Charley Baker  wrote:
> > > > > Could also use multiple attributes:
>
> > > > > browser.link(:index => 1, :text => /Click This Link/).click
>
> > > > > or xpath.
>
> > > > > Charley Baker
> > > > > blog:http://blog.charleybaker.org/
> > > > > Lead Developer, Watir,http://wtr.rubyforge.org
> > > > > QA Architect, Gap Inc Direct
>
> > > > > On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> > > > > wrote:
>
> > > > > > Browser.link(:text,/Click This Link/).click
>
> > > > > > -Original Message-
> > > > > > From: watir-general@googlegroups.com
> > > > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > > > Sent: Wednesday, June 03, 2009 11:08 AM
> > > > > > To: Watir General
> > > > > > Subject: [wtr-general] Finding a specific instance of a repeated
> > link
> > > > > > via text surrounding it.
>
> > > > > > I'm trying to figure out how to click on a link, and the only way I
> > > > > > know which link to click on is from text that comes before it.
> > > > > > Otherwise, it looks the same as other links on the same page.
>
> > > > > > So for instance, the html might look like:
>
> > > > > > Click This Link
> > > > > > 
> > > > > > http://clickhere.com";>The Link
> > > > > > 
> > > > > > But Not this link
> > > > > > 
> > > > > > http://clickhere.com";>The Link
>
> > > > > > I want to be able to read the page 

[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread Darin Duphorn
Yep, that would probable work better, that way when you update you
libraries (re-install) you wouldn't have to re-enter the tags in the
non_controlling_element.rb,

 

I've been meaning to get around to do that.

 

DD

 



From: watir-general@googlegroups.com
[mailto:watir-gene...@googlegroups.com] On Behalf Of Charley Baker
Sent: Wednesday, June 03, 2009 11:51 AM
To: watir-general@googlegroups.com
Subject: [wtr-general] Re: Finding a specific instance of a repeated
link via text surrounding it.

 

Zeljko has a blog entry for extending support to other elements as well.
We don't currently support , we do support ,  and some other
"lesser?" tags. Z just answered a question on this yesterday or the day
before with a link to his blog post, take a look through the group. 

Otherwise the basic idea is create watir_ext.rb or whatever you want to
name it file. 

module Watir
  class B < NonControlElement
TAG = 'B'
  end
end


require that your file before accessing the b element and all should be
good: 

browser.link(:after?, browser.b(:text, 'Click me')).click

NB: The syntax looks right, but no guarantees if you copy/paste that
it's dead on. :) 



Charley Baker
blog: http://blog.charleybaker.org/
Lead Developer, Watir, http://wtr.rubyforge.org
QA Architect, Gap Inc Direct



On Wed, Jun 3, 2009 at 10:41 AM, Darin Duphorn
 wrote:


Navigate to this thread, if you have any question feel free to keep
asking.

http://groups.google.com/group/watir-general/browse_thread/thread/1e4939
0656d50cce/6fa3f8043da3cbe9?hl=en&lnk=gst&q=dd+tag#6fa3f8043da3cbe9




-Original Message-
From: watir-general@googlegroups.com
[mailto:watir-gene...@googlegroups.com] On Behalf Of James

Sent: Wednesday, June 03, 2009 11:39 AM
To: Watir General
Subject: [wtr-general] Re: Finding a specific instance of a repeated
link via text surrounding it.


Thanks Darin - that's really helpful!  Now I just need to know how to
latch onto the text surrounded by the .  Any ideas?  If that
works, then I can definitely use the "after?" method to grab the link
after it.

(I'm still looking at xpath, but I've never used xpath before and am
finding it quite confusing!)

Thanks,
James


On Jun 3, 12:27 pm, "Darin Duphorn" 
wrote:
> Below is code that gets the div that appears after a label, this might
also help.
>
> label_id = $ie.div(:after?, $ie.label(:text,'Home')).span(:index,1)  
>
> -Original Message-
> From: watir-general@googlegroups.com
[mailto:watir-gene...@googlegroups.com] On Behalf Of James
> Sent: Wednesday, June 03, 2009 11:24 AM
> To: Watir General
> Subject: [wtr-general] Re: Finding a specific instance of a repeated
link via text surrounding it.
>
> It's more like I just want to grab an element based on where it is in
> reference to another element, or in reference to text on the page.
>
> I noticed Charley's mention of xpath and am looking into it right now
> - I think it might be what I'm looking for, unless someone has another
> suggestion.
>
> James
>
> On Jun 3, 12:21 pm, "Darin Duphorn" 
> wrote:
> > Ok, you want to us the information in the  tag to determine what
link to click.
>
> > But the  isn't a supported tag, so you don't know how to use it.
>
> > Is this a correct?
>
> > -Original Message-
> > From: watir-general@googlegroups.com
[mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > Sent: Wednesday, June 03, 2009 11:17 AM
> > To: Watir General
> > Subject: [wtr-general] Re: Finding a specific instance of a repeated
link via text surrounding it.
>
> > But the text I'm referring to isn't part of the link itself.  The
link
> > text is the same.  I'm looking at the text that occurs -before- (or
> > possibly after) the link.
>
> > Thanks for your suggestions, but unfortunately, in this example, it
> > won't work.
>
> > James
>
> > On Jun 3, 12:13 pm, Charley Baker  wrote:
> > > Could also use multiple attributes:
>
> > > browser.link(:index => 1, :text => /Click This Link/).click
>
> > > or xpath.
>
> > > Charley Baker
> > > blog:http://blog.charleybaker.org/
> > > Lead Developer, Watir,http://wtr.rubyforge.org
> > > QA Architect, Gap Inc Direct
>
> > > On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> > > wrote:
>
> > > > Browser.link(:text,/Click This Link/).click
>
> > > > -Original Message-
> > > > From: watir-general@googlegroups.com
> > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > Sent: Wednesday, June 03, 2009 11:08 AM
> > > > To: Watir General
> > > > Subject: [wtr-general] Finding a specific instance of a repeated
link
> > > > via text surrounding it.
>
> > > > I'm trying to figure out how to click on a link, and the only
way I
> > > > know which link to click on is from text that comes before it.
> > > > Otherwise, it looks the same as other links on the same page.
>
> > > > So for instance, the html might look like:
>
> > > > Click This Link
> > > > 
> > > > http://clickhere.com";>The Link
> > > > 
> > > > But Not thi

[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread Charley Baker
Zeljko has a blog entry for extending support to other elements as well. We
don't currently support , we do support ,  and some other
"lesser?" tags. Z just answered a question on this yesterday or the day
before with a link to his blog post, take a look through the group.

Otherwise the basic idea is create watir_ext.rb or whatever you want to name
it file.

module Watir
  class B < NonControlElement
TAG = 'B'
  end
end


require that your file before accessing the b element and all should be
good:

browser.link(:after?, browser.b(:text, 'Click me')).click

NB: The syntax looks right, but no guarantees if you copy/paste that it's
dead on. :)



Charley Baker
blog: http://blog.charleybaker.org/
Lead Developer, Watir, http://wtr.rubyforge.org
QA Architect, Gap Inc Direct


On Wed, Jun 3, 2009 at 10:41 AM, Darin Duphorn
wrote:

>
> Navigate to this thread, if you have any question feel free to keep asking.
>
>
> http://groups.google.com/group/watir-general/browse_thread/thread/1e49390656d50cce/6fa3f8043da3cbe9?hl=en&lnk=gst&q=dd+tag#6fa3f8043da3cbe9
>
>
>
> -Original Message-
> From: watir-general@googlegroups.com [mailto:
> watir-gene...@googlegroups.com] On Behalf Of James
> Sent: Wednesday, June 03, 2009 11:39 AM
> To: Watir General
> Subject: [wtr-general] Re: Finding a specific instance of a repeated link
> via text surrounding it.
>
>
> Thanks Darin - that's really helpful!  Now I just need to know how to
> latch onto the text surrounded by the .  Any ideas?  If that
> works, then I can definitely use the "after?" method to grab the link
> after it.
>
> (I'm still looking at xpath, but I've never used xpath before and am
> finding it quite confusing!)
>
> Thanks,
> James
>
>
> On Jun 3, 12:27 pm, "Darin Duphorn" 
> wrote:
> > Below is code that gets the div that appears after a label, this might
> also help.
> >
> > label_id = $ie.div(:after?, $ie.label(:text,'Home')).span(:index,1)
> >
> > -Original Message-
> > From: watir-general@googlegroups.com [mailto:
> watir-gene...@googlegroups.com] On Behalf Of James
> > Sent: Wednesday, June 03, 2009 11:24 AM
> > To: Watir General
> > Subject: [wtr-general] Re: Finding a specific instance of a repeated link
> via text surrounding it.
> >
> > It's more like I just want to grab an element based on where it is in
> > reference to another element, or in reference to text on the page.
> >
> > I noticed Charley's mention of xpath and am looking into it right now
> > - I think it might be what I'm looking for, unless someone has another
> > suggestion.
> >
> > James
> >
> > On Jun 3, 12:21 pm, "Darin Duphorn" 
> > wrote:
> > > Ok, you want to us the information in the  tag to determine what
> link to click.
> >
> > > But the  isn't a supported tag, so you don't know how to use it.
> >
> > > Is this a correct?
> >
> > > -Original Message-
> > > From: watir-general@googlegroups.com [mailto:
> watir-gene...@googlegroups.com] On Behalf Of James
> > > Sent: Wednesday, June 03, 2009 11:17 AM
> > > To: Watir General
> > > Subject: [wtr-general] Re: Finding a specific instance of a repeated
> link via text surrounding it.
> >
> > > But the text I'm referring to isn't part of the link itself.  The link
> > > text is the same.  I'm looking at the text that occurs -before- (or
> > > possibly after) the link.
> >
> > > Thanks for your suggestions, but unfortunately, in this example, it
> > > won't work.
> >
> > > James
> >
> > > On Jun 3, 12:13 pm, Charley Baker  wrote:
> > > > Could also use multiple attributes:
> >
> > > > browser.link(:index => 1, :text => /Click This Link/).click
> >
> > > > or xpath.
> >
> > > > Charley Baker
> > > > blog:http://blog.charleybaker.org/
> > > > Lead Developer, Watir,http://wtr.rubyforge.org
> > > > QA Architect, Gap Inc Direct
> >
> > > > On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> > > > wrote:
> >
> > > > > Browser.link(:text,/Click This Link/).click
> >
> > > > > -Original Message-
> > > > > From: watir-general@googlegroups.com
> > > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > > Sent: Wednesday, June 03, 2009 11:08 AM
> > > > > To: Watir General
> > > > > Subject: [wtr-general] Finding a specific instance of a repeated
> link
> > > > > via text surrounding it.
> >
> > > > > I'm trying to figure out how to click on a link, and the only way I
> > > > > know which link to click on is from text that comes before it.
> > > > > Otherwise, it looks the same as other links on the same page.
> >
> > > > > So for instance, the html might look like:
> >
> > > > > Click This Link
> > > > > 
> > > > > http://clickhere.com";>The Link
> > > > > 
> > > > > But Not this link
> > > > > 
> > > > > http://clickhere.com";>The Link
> >
> > > > > I want to be able to read the page and latch onto the link with the
> > > > > "Click This Link" but not other ones.  In fact, if there are
> multiple
> > > > > "Click This Link" links, I want to be able to find all of them, and
> > > > > ignore the res

[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread Darin Duphorn

Navigate to this thread, if you have any question feel free to keep asking.

http://groups.google.com/group/watir-general/browse_thread/thread/1e49390656d50cce/6fa3f8043da3cbe9?hl=en&lnk=gst&q=dd+tag#6fa3f8043da3cbe9



-Original Message-
From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On 
Behalf Of James
Sent: Wednesday, June 03, 2009 11:39 AM
To: Watir General
Subject: [wtr-general] Re: Finding a specific instance of a repeated link via 
text surrounding it.


Thanks Darin - that's really helpful!  Now I just need to know how to
latch onto the text surrounded by the .  Any ideas?  If that
works, then I can definitely use the "after?" method to grab the link
after it.

(I'm still looking at xpath, but I've never used xpath before and am
finding it quite confusing!)

Thanks,
James


On Jun 3, 12:27 pm, "Darin Duphorn" 
wrote:
> Below is code that gets the div that appears after a label, this might also 
> help.
>
> label_id = $ie.div(:after?, $ie.label(:text,'Home')).span(:index,1)  
>
> -Original Message-
> From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] 
> On Behalf Of James
> Sent: Wednesday, June 03, 2009 11:24 AM
> To: Watir General
> Subject: [wtr-general] Re: Finding a specific instance of a repeated link via 
> text surrounding it.
>
> It's more like I just want to grab an element based on where it is in
> reference to another element, or in reference to text on the page.
>
> I noticed Charley's mention of xpath and am looking into it right now
> - I think it might be what I'm looking for, unless someone has another
> suggestion.
>
> James
>
> On Jun 3, 12:21 pm, "Darin Duphorn" 
> wrote:
> > Ok, you want to us the information in the  tag to determine what link to 
> > click.
>
> > But the  isn't a supported tag, so you don't know how to use it.
>
> > Is this a correct?
>
> > -Original Message-
> > From: watir-general@googlegroups.com 
> > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > Sent: Wednesday, June 03, 2009 11:17 AM
> > To: Watir General
> > Subject: [wtr-general] Re: Finding a specific instance of a repeated link 
> > via text surrounding it.
>
> > But the text I'm referring to isn't part of the link itself.  The link
> > text is the same.  I'm looking at the text that occurs -before- (or
> > possibly after) the link.
>
> > Thanks for your suggestions, but unfortunately, in this example, it
> > won't work.
>
> > James
>
> > On Jun 3, 12:13 pm, Charley Baker  wrote:
> > > Could also use multiple attributes:
>
> > > browser.link(:index => 1, :text => /Click This Link/).click
>
> > > or xpath.
>
> > > Charley Baker
> > > blog:http://blog.charleybaker.org/
> > > Lead Developer, Watir,http://wtr.rubyforge.org
> > > QA Architect, Gap Inc Direct
>
> > > On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> > > wrote:
>
> > > > Browser.link(:text,/Click This Link/).click
>
> > > > -Original Message-
> > > > From: watir-general@googlegroups.com
> > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > Sent: Wednesday, June 03, 2009 11:08 AM
> > > > To: Watir General
> > > > Subject: [wtr-general] Finding a specific instance of a repeated link
> > > > via text surrounding it.
>
> > > > I'm trying to figure out how to click on a link, and the only way I
> > > > know which link to click on is from text that comes before it.
> > > > Otherwise, it looks the same as other links on the same page.
>
> > > > So for instance, the html might look like:
>
> > > > Click This Link
> > > > 
> > > > http://clickhere.com";>The Link
> > > > 
> > > > But Not this link
> > > > 
> > > > http://clickhere.com";>The Link
>
> > > > I want to be able to read the page and latch onto the link with the
> > > > "Click This Link" but not other ones.  In fact, if there are multiple
> > > > "Click This Link" links, I want to be able to find all of them, and
> > > > ignore the rest.
>
> > > > I'm at a loss how to do this with Watir.  I'm used to being able to
> > > > find things by div and id tags, etc., but this is a dumbed down page
> > > > meant for mobile devices and it lacks almost all of the things I'm
> > > > used to latching onto.
>
> > > > Any suggestions?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread James

Thanks Darin - that's really helpful!  Now I just need to know how to
latch onto the text surrounded by the .  Any ideas?  If that
works, then I can definitely use the "after?" method to grab the link
after it.

(I'm still looking at xpath, but I've never used xpath before and am
finding it quite confusing!)

Thanks,
James


On Jun 3, 12:27 pm, "Darin Duphorn" 
wrote:
> Below is code that gets the div that appears after a label, this might also 
> help.
>
> label_id = $ie.div(:after?, $ie.label(:text,'Home')).span(:index,1)  
>
> -Original Message-
> From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] 
> On Behalf Of James
> Sent: Wednesday, June 03, 2009 11:24 AM
> To: Watir General
> Subject: [wtr-general] Re: Finding a specific instance of a repeated link via 
> text surrounding it.
>
> It's more like I just want to grab an element based on where it is in
> reference to another element, or in reference to text on the page.
>
> I noticed Charley's mention of xpath and am looking into it right now
> - I think it might be what I'm looking for, unless someone has another
> suggestion.
>
> James
>
> On Jun 3, 12:21 pm, "Darin Duphorn" 
> wrote:
> > Ok, you want to us the information in the  tag to determine what link to 
> > click.
>
> > But the  isn't a supported tag, so you don't know how to use it.
>
> > Is this a correct?
>
> > -Original Message-
> > From: watir-general@googlegroups.com 
> > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > Sent: Wednesday, June 03, 2009 11:17 AM
> > To: Watir General
> > Subject: [wtr-general] Re: Finding a specific instance of a repeated link 
> > via text surrounding it.
>
> > But the text I'm referring to isn't part of the link itself.  The link
> > text is the same.  I'm looking at the text that occurs -before- (or
> > possibly after) the link.
>
> > Thanks for your suggestions, but unfortunately, in this example, it
> > won't work.
>
> > James
>
> > On Jun 3, 12:13 pm, Charley Baker  wrote:
> > > Could also use multiple attributes:
>
> > > browser.link(:index => 1, :text => /Click This Link/).click
>
> > > or xpath.
>
> > > Charley Baker
> > > blog:http://blog.charleybaker.org/
> > > Lead Developer, Watir,http://wtr.rubyforge.org
> > > QA Architect, Gap Inc Direct
>
> > > On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> > > wrote:
>
> > > > Browser.link(:text,/Click This Link/).click
>
> > > > -Original Message-
> > > > From: watir-general@googlegroups.com
> > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > Sent: Wednesday, June 03, 2009 11:08 AM
> > > > To: Watir General
> > > > Subject: [wtr-general] Finding a specific instance of a repeated link
> > > > via text surrounding it.
>
> > > > I'm trying to figure out how to click on a link, and the only way I
> > > > know which link to click on is from text that comes before it.
> > > > Otherwise, it looks the same as other links on the same page.
>
> > > > So for instance, the html might look like:
>
> > > > Click This Link
> > > > 
> > > > http://clickhere.com";>The Link
> > > > 
> > > > But Not this link
> > > > 
> > > > http://clickhere.com";>The Link
>
> > > > I want to be able to read the page and latch onto the link with the
> > > > "Click This Link" but not other ones.  In fact, if there are multiple
> > > > "Click This Link" links, I want to be able to find all of them, and
> > > > ignore the rest.
>
> > > > I'm at a loss how to do this with Watir.  I'm used to being able to
> > > > find things by div and id tags, etc., but this is a dumbed down page
> > > > meant for mobile devices and it lacks almost all of the things I'm
> > > > used to latching onto.
>
> > > > Any suggestions?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread Darin Duphorn

Below is code that gets the div that appears after a label, this might also 
help.


label_id = $ie.div(:after?, $ie.label(:text,'Home')).span(:index,1)   



-Original Message-
From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On 
Behalf Of James
Sent: Wednesday, June 03, 2009 11:24 AM
To: Watir General
Subject: [wtr-general] Re: Finding a specific instance of a repeated link via 
text surrounding it.


It's more like I just want to grab an element based on where it is in
reference to another element, or in reference to text on the page.

I noticed Charley's mention of xpath and am looking into it right now
- I think it might be what I'm looking for, unless someone has another
suggestion.

James

On Jun 3, 12:21 pm, "Darin Duphorn" 
wrote:
> Ok, you want to us the information in the  tag to determine what link to 
> click.
>
> But the  isn't a supported tag, so you don't know how to use it.
>
> Is this a correct?
>
> -Original Message-
> From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] 
> On Behalf Of James
> Sent: Wednesday, June 03, 2009 11:17 AM
> To: Watir General
> Subject: [wtr-general] Re: Finding a specific instance of a repeated link via 
> text surrounding it.
>
> But the text I'm referring to isn't part of the link itself.  The link
> text is the same.  I'm looking at the text that occurs -before- (or
> possibly after) the link.
>
> Thanks for your suggestions, but unfortunately, in this example, it
> won't work.
>
> James
>
> On Jun 3, 12:13 pm, Charley Baker  wrote:
> > Could also use multiple attributes:
>
> > browser.link(:index => 1, :text => /Click This Link/).click
>
> > or xpath.
>
> > Charley Baker
> > blog:http://blog.charleybaker.org/
> > Lead Developer, Watir,http://wtr.rubyforge.org
> > QA Architect, Gap Inc Direct
>
> > On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> > wrote:
>
> > > Browser.link(:text,/Click This Link/).click
>
> > > -Original Message-
> > > From: watir-general@googlegroups.com
> > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > Sent: Wednesday, June 03, 2009 11:08 AM
> > > To: Watir General
> > > Subject: [wtr-general] Finding a specific instance of a repeated link
> > > via text surrounding it.
>
> > > I'm trying to figure out how to click on a link, and the only way I
> > > know which link to click on is from text that comes before it.
> > > Otherwise, it looks the same as other links on the same page.
>
> > > So for instance, the html might look like:
>
> > > Click This Link
> > > 
> > > http://clickhere.com";>The Link
> > > 
> > > But Not this link
> > > 
> > > http://clickhere.com";>The Link
>
> > > I want to be able to read the page and latch onto the link with the
> > > "Click This Link" but not other ones.  In fact, if there are multiple
> > > "Click This Link" links, I want to be able to find all of them, and
> > > ignore the rest.
>
> > > I'm at a loss how to do this with Watir.  I'm used to being able to
> > > find things by div and id tags, etc., but this is a dumbed down page
> > > meant for mobile devices and it lacks almost all of the things I'm
> > > used to latching onto.
>
> > > Any suggestions?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread Charley Baker
xpath will work, I don't use it much, but it will work. There's also a
beforetext and aftertext way to get it, but if remember right, we might be
removing that at some point.


Charley Baker
blog: http://blog.charleybaker.org/
Lead Developer, Watir, http://wtr.rubyforge.org
QA Architect, Gap Inc Direct


On Wed, Jun 3, 2009 at 10:23 AM, James  wrote:

>
> It's more like I just want to grab an element based on where it is in
> reference to another element, or in reference to text on the page.
>
> I noticed Charley's mention of xpath and am looking into it right now
> - I think it might be what I'm looking for, unless someone has another
> suggestion.
>
> James
>
> On Jun 3, 12:21 pm, "Darin Duphorn" 
> wrote:
> > Ok, you want to us the information in the  tag to determine what link
> to click.
> >
> > But the  isn't a supported tag, so you don't know how to use it.
> >
> > Is this a correct?
> >
> > -Original Message-
> > From: watir-general@googlegroups.com [mailto:
> watir-gene...@googlegroups.com] On Behalf Of James
> > Sent: Wednesday, June 03, 2009 11:17 AM
> > To: Watir General
> > Subject: [wtr-general] Re: Finding a specific instance of a repeated link
> via text surrounding it.
> >
> > But the text I'm referring to isn't part of the link itself.  The link
> > text is the same.  I'm looking at the text that occurs -before- (or
> > possibly after) the link.
> >
> > Thanks for your suggestions, but unfortunately, in this example, it
> > won't work.
> >
> > James
> >
> > On Jun 3, 12:13 pm, Charley Baker  wrote:
> > > Could also use multiple attributes:
> >
> > > browser.link(:index => 1, :text => /Click This Link/).click
> >
> > > or xpath.
> >
> > > Charley Baker
> > > blog:http://blog.charleybaker.org/
> > > Lead Developer, Watir,http://wtr.rubyforge.org
> > > QA Architect, Gap Inc Direct
> >
> > > On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> > > wrote:
> >
> > > > Browser.link(:text,/Click This Link/).click
> >
> > > > -Original Message-
> > > > From: watir-general@googlegroups.com
> > > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > > Sent: Wednesday, June 03, 2009 11:08 AM
> > > > To: Watir General
> > > > Subject: [wtr-general] Finding a specific instance of a repeated link
> > > > via text surrounding it.
> >
> > > > I'm trying to figure out how to click on a link, and the only way I
> > > > know which link to click on is from text that comes before it.
> > > > Otherwise, it looks the same as other links on the same page.
> >
> > > > So for instance, the html might look like:
> >
> > > > Click This Link
> > > > 
> > > > http://clickhere.com";>The Link
> > > > 
> > > > But Not this link
> > > > 
> > > > http://clickhere.com";>The Link
> >
> > > > I want to be able to read the page and latch onto the link with the
> > > > "Click This Link" but not other ones.  In fact, if there are multiple
> > > > "Click This Link" links, I want to be able to find all of them, and
> > > > ignore the rest.
> >
> > > > I'm at a loss how to do this with Watir.  I'm used to being able to
> > > > find things by div and id tags, etc., but this is a dumbed down page
> > > > meant for mobile devices and it lacks almost all of the things I'm
> > > > used to latching onto.
> >
> > > > Any suggestions?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread James

It's more like I just want to grab an element based on where it is in
reference to another element, or in reference to text on the page.

I noticed Charley's mention of xpath and am looking into it right now
- I think it might be what I'm looking for, unless someone has another
suggestion.

James

On Jun 3, 12:21 pm, "Darin Duphorn" 
wrote:
> Ok, you want to us the information in the  tag to determine what link to 
> click.
>
> But the  isn't a supported tag, so you don't know how to use it.
>
> Is this a correct?
>
> -Original Message-
> From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] 
> On Behalf Of James
> Sent: Wednesday, June 03, 2009 11:17 AM
> To: Watir General
> Subject: [wtr-general] Re: Finding a specific instance of a repeated link via 
> text surrounding it.
>
> But the text I'm referring to isn't part of the link itself.  The link
> text is the same.  I'm looking at the text that occurs -before- (or
> possibly after) the link.
>
> Thanks for your suggestions, but unfortunately, in this example, it
> won't work.
>
> James
>
> On Jun 3, 12:13 pm, Charley Baker  wrote:
> > Could also use multiple attributes:
>
> > browser.link(:index => 1, :text => /Click This Link/).click
>
> > or xpath.
>
> > Charley Baker
> > blog:http://blog.charleybaker.org/
> > Lead Developer, Watir,http://wtr.rubyforge.org
> > QA Architect, Gap Inc Direct
>
> > On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> > wrote:
>
> > > Browser.link(:text,/Click This Link/).click
>
> > > -Original Message-
> > > From: watir-general@googlegroups.com
> > > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > > Sent: Wednesday, June 03, 2009 11:08 AM
> > > To: Watir General
> > > Subject: [wtr-general] Finding a specific instance of a repeated link
> > > via text surrounding it.
>
> > > I'm trying to figure out how to click on a link, and the only way I
> > > know which link to click on is from text that comes before it.
> > > Otherwise, it looks the same as other links on the same page.
>
> > > So for instance, the html might look like:
>
> > > Click This Link
> > > 
> > > http://clickhere.com";>The Link
> > > 
> > > But Not this link
> > > 
> > > http://clickhere.com";>The Link
>
> > > I want to be able to read the page and latch onto the link with the
> > > "Click This Link" but not other ones.  In fact, if there are multiple
> > > "Click This Link" links, I want to be able to find all of them, and
> > > ignore the rest.
>
> > > I'm at a loss how to do this with Watir.  I'm used to being able to
> > > find things by div and id tags, etc., but this is a dumbed down page
> > > meant for mobile devices and it lacks almost all of the things I'm
> > > used to latching onto.
>
> > > Any suggestions?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread Darin Duphorn




Ok, you want to us the information in the  tag to determine what link to 
click.

But the  isn't a supported tag, so you don't know how to use it.

Is this a correct?
 
-Original Message-
From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On 
Behalf Of James
Sent: Wednesday, June 03, 2009 11:17 AM
To: Watir General
Subject: [wtr-general] Re: Finding a specific instance of a repeated link via 
text surrounding it.


But the text I'm referring to isn't part of the link itself.  The link
text is the same.  I'm looking at the text that occurs -before- (or
possibly after) the link.

Thanks for your suggestions, but unfortunately, in this example, it
won't work.

James

On Jun 3, 12:13 pm, Charley Baker  wrote:
> Could also use multiple attributes:
>
> browser.link(:index => 1, :text => /Click This Link/).click
>
> or xpath.
>
> Charley Baker
> blog:http://blog.charleybaker.org/
> Lead Developer, Watir,http://wtr.rubyforge.org
> QA Architect, Gap Inc Direct
>
> On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> wrote:
>
>
>
> > Browser.link(:text,/Click This Link/).click
>
> > -Original Message-
> > From: watir-general@googlegroups.com
> > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > Sent: Wednesday, June 03, 2009 11:08 AM
> > To: Watir General
> > Subject: [wtr-general] Finding a specific instance of a repeated link
> > via text surrounding it.
>
> > I'm trying to figure out how to click on a link, and the only way I
> > know which link to click on is from text that comes before it.
> > Otherwise, it looks the same as other links on the same page.
>
> > So for instance, the html might look like:
>
> > Click This Link
> > 
> > http://clickhere.com";>The Link
> > 
> > But Not this link
> > 
> > http://clickhere.com";>The Link
>
> > I want to be able to read the page and latch onto the link with the
> > "Click This Link" but not other ones.  In fact, if there are multiple
> > "Click This Link" links, I want to be able to find all of them, and
> > ignore the rest.
>
> > I'm at a loss how to do this with Watir.  I'm used to being able to
> > find things by div and id tags, etc., but this is a dumbed down page
> > meant for mobile devices and it lacks almost all of the things I'm
> > used to latching onto.
>
> > Any suggestions?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread James

But the text I'm referring to isn't part of the link itself.  The link
text is the same.  I'm looking at the text that occurs -before- (or
possibly after) the link.

Thanks for your suggestions, but unfortunately, in this example, it
won't work.

James

On Jun 3, 12:13 pm, Charley Baker  wrote:
> Could also use multiple attributes:
>
> browser.link(:index => 1, :text => /Click This Link/).click
>
> or xpath.
>
> Charley Baker
> blog:http://blog.charleybaker.org/
> Lead Developer, Watir,http://wtr.rubyforge.org
> QA Architect, Gap Inc Direct
>
> On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
> wrote:
>
>
>
> > Browser.link(:text,/Click This Link/).click
>
> > -Original Message-
> > From: watir-general@googlegroups.com
> > [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> > Sent: Wednesday, June 03, 2009 11:08 AM
> > To: Watir General
> > Subject: [wtr-general] Finding a specific instance of a repeated link
> > via text surrounding it.
>
> > I'm trying to figure out how to click on a link, and the only way I
> > know which link to click on is from text that comes before it.
> > Otherwise, it looks the same as other links on the same page.
>
> > So for instance, the html might look like:
>
> > Click This Link
> > 
> > http://clickhere.com";>The Link
> > 
> > But Not this link
> > 
> > http://clickhere.com";>The Link
>
> > I want to be able to read the page and latch onto the link with the
> > "Click This Link" but not other ones.  In fact, if there are multiple
> > "Click This Link" links, I want to be able to find all of them, and
> > ignore the rest.
>
> > I'm at a loss how to do this with Watir.  I'm used to being able to
> > find things by div and id tags, etc., but this is a dumbed down page
> > meant for mobile devices and it lacks almost all of the things I'm
> > used to latching onto.
>
> > Any suggestions?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread Charley Baker
Could also use multiple attributes:

browser.link(:index => 1, :text => /Click This Link/).click

or xpath.


Charley Baker
blog: http://blog.charleybaker.org/
Lead Developer, Watir, http://wtr.rubyforge.org
QA Architect, Gap Inc Direct


On Wed, Jun 3, 2009 at 10:10 AM, Darin Duphorn
wrote:

>
> Browser.link(:text,/Click This Link/).click
>
> -Original Message-
> From: watir-general@googlegroups.com
> [mailto:watir-gene...@googlegroups.com] On Behalf Of James
> Sent: Wednesday, June 03, 2009 11:08 AM
> To: Watir General
> Subject: [wtr-general] Finding a specific instance of a repeated link
> via text surrounding it.
>
>
> I'm trying to figure out how to click on a link, and the only way I
> know which link to click on is from text that comes before it.
> Otherwise, it looks the same as other links on the same page.
>
> So for instance, the html might look like:
>
> Click This Link
> 
> http://clickhere.com";>The Link
> 
> But Not this link
> 
> http://clickhere.com";>The Link
>
>
> I want to be able to read the page and latch onto the link with the
> "Click This Link" but not other ones.  In fact, if there are multiple
> "Click This Link" links, I want to be able to find all of them, and
> ignore the rest.
>
> I'm at a loss how to do this with Watir.  I'm used to being able to
> find things by div and id tags, etc., but this is a dumbed down page
> meant for mobile devices and it lacks almost all of the things I'm
> used to latching onto.
>
> Any suggestions?
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread Darin Duphorn

Browser.link(:text,/Click This Link/).click

-Original Message-
From: watir-general@googlegroups.com
[mailto:watir-gene...@googlegroups.com] On Behalf Of James
Sent: Wednesday, June 03, 2009 11:08 AM
To: Watir General
Subject: [wtr-general] Finding a specific instance of a repeated link
via text surrounding it.


I'm trying to figure out how to click on a link, and the only way I
know which link to click on is from text that comes before it.
Otherwise, it looks the same as other links on the same page.

So for instance, the html might look like:

Click This Link

http://clickhere.com";>The Link

But Not this link

http://clickhere.com";>The Link


I want to be able to read the page and latch onto the link with the
"Click This Link" but not other ones.  In fact, if there are multiple
"Click This Link" links, I want to be able to find all of them, and
ignore the rest.

I'm at a loss how to do this with Watir.  I'm used to being able to
find things by div and id tags, etc., but this is a dumbed down page
meant for mobile devices and it lacks almost all of the things I'm
used to latching onto.

Any suggestions?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Finding a specific instance of a repeated link via text surrounding it.

2009-06-03 Thread James

I'm trying to figure out how to click on a link, and the only way I
know which link to click on is from text that comes before it.
Otherwise, it looks the same as other links on the same page.

So for instance, the html might look like:

Click This Link

http://clickhere.com";>The Link

But Not this link

http://clickhere.com";>The Link


I want to be able to read the page and latch onto the link with the
"Click This Link" but not other ones.  In fact, if there are multiple
"Click This Link" links, I want to be able to find all of them, and
ignore the rest.

I'm at a loss how to do this with Watir.  I'm used to being able to
find things by div and id tags, etc., but this is a dumbed down page
meant for mobile devices and it lacks almost all of the things I'm
used to latching onto.

Any suggestions?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: override js confirm FireWatir

2009-06-03 Thread Paul Rogers
i think there is a 'no pop up' plug in for firefox, which deals with alert
boxes, security pop ups etc. I did a quick google for it yesterday for an
entirely different reason, and didnt find it, but I wasnt trying too hard.
It might be another solution to this problem

Paul

On Wed, Jun 3, 2009 at 3:19 AM, aidy lewis wrote:

>
> Chuck
>
> 2009/6/2 Chuck van der Linden :
> >
> > Have you reviewed the general info on the types of popups and how to
> > handle them?  http://wiki.openqa.org/display/WTR/Pop+Ups
> >
>
> The aim was to override the js confirm function without using wsh or
> the autoit wrapper that is shown in these examples, which I have
> successfully accomplished in IE using the execScript method.
>
>
> Aidy
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: forms in subframes - elements not found

2009-06-03 Thread aidy lewis

Hi Jason

How then would you explain this?


 require 'rubygems'
 require 'watir'

 ['watir', 'firewatir'].each { | g | require g }
 ie = Watir::IE.new
 ff = FireWatir::Firefox.new
 [ie, ff].each { |b| b.goto("http://www.google.com";) }
 ff.table(:index, 1).rows[0].html
 ie.table(:index, 1).rows[0].html


Aidy

2009/6/3 jason :
>
> firewatir index for all elements starts and frames starts with 1
> index 0 should be the root document (but its not :-( )
> so thanks for the thought
> jason.
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: forms in subframes - elements not found

2009-06-03 Thread jason

firewatir index for all elements starts and frames starts with 1
index 0 should be the root document (but its not :-( )
so thanks for the thought
jason.

On 3 Jun., 15:29, aidy lewis  wrote:
> > ff.frame(:index, 1).form(:name, "lay0803234_src350a").select_list(:id,
> > "LOV6") .inspect
>
> Try :index, 0
>
> Aidy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Check div for null return

2009-06-03 Thread Jerry Lane
Not sure how the cucumber example is working but the assert boolean if
wokring would do this test perfectly.

I know how the assert is checking bor the text etc ang how the timer is
working but either the timer function is not working (most likely) or the
boolean if statement is not funcitoning. The second that the line

if jsToEval = 'Ext.query("div.x-tool")[0].click()' #check for x and click if
present
@@ie.document.parentWindow.eval(jsToEval)

executes the waitir test suite finishishes which indicates that it is not
waiting for 35 seconds to see if loading disappears?

2009/6/3 aidy lewis 

>
> 2009/6/3 Jerry Lane :
> > Can I just use a simple if to do that thou? Something simple such as
> >
> >   if boolean = true
> > puts 'Test Passed'
> >   else
> > puts 'Test Failed'
> >   end
>
> xUnit saves you from writing your own assertions (as above). Although
> I believe it to be of the wrong narrative for business facing tests.
>
> Look at:
>
>
> http://github.com/aslakhellesoy/cucumber/tree/9606fe835c84ed56ff5c41720a6fdbd6289feaa4/examples/watir/features
>
>
> Aidy
>
> >
>


-- 
Jerry

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Check div for null return

2009-06-03 Thread aidy lewis

2009/6/3 Jerry Lane :
> Can I just use a simple if to do that thou? Something simple such as
>
>   if boolean = true
>     puts 'Test Passed'
>   else
>     puts 'Test Failed'
>   end

xUnit saves you from writing your own assertions (as above). Although
I believe it to be of the wrong narrative for business facing tests.

Look at:

http://github.com/aslakhellesoy/cucumber/tree/9606fe835c84ed56ff5c41720a6fdbd6289feaa4/examples/watir/features


Aidy

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: XPath and ñ

2009-06-03 Thread aidy lewis

As I side note I have replaced REXML with nokogiri which will greatly
improve the speed of your IE tests (at a guess 3 - 5 times faster)

http://github.com/aidylewis/watir/blob/467c42a079c6f0b3e78a187353e288f8e3787503/watir/lib/watir/ie-class.rb

Aidy

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Check div for null return

2009-06-03 Thread Jerry Lane
Can I just use a simple if to do that thou? Something simple such as

  if boolean = true
puts 'Test Passed'
  else
puts 'Test Failed'
  end
Is there documentation of Boolean anywhere in relation to tracker? The test
is very simple but gettingg the report from the div is driving me insane,
The problem is Loading... will be present for a few seconds regardless, the
issue only arises when it does not disappear after a few minutes.
2009/6/3 aidy lewis 

>
> The predicate '?' in Ruby indicates that the method returns a Boolean.
>
> The wait_for? method will 'yield' if that block is true.
>
> And then we are asserting whether that block is true or false.
>
> Aidy
>
> 2009/6/3 Jerry Lane :
>  > I am confused as to how you assert the boolean. Is it simply a true or
> > false?
> >
> > 2009/6/3 aidy lewis 
> >>
> >>  def wait_for?(seconds=0)
> >>   slept = 0
> >>   until yield || slept == seconds
> >> sleep 0.5
> >> slept += 0.5
> >>   end
> >>   yield
> >>  end
> >>
> >>
> >> boolean = wait_for?(35) { @@ie.div(:text, 'Loading...').exists? }
> >> assert(boolean)
> >>
> >> #you may get more benefit from using Rspec or Cucumber
> >>
> >> Aidy
> >>
> >> 2009/6/3 Jer :
> >> >
> >> > Hi all,
> >> > Just wondering can anyone help me with this code. I just want to check
> >> > my assert at the finish to see if the value "loading..." is present.
> >> > If after 35 seconds it is present I want it to fail, if it is gone
> >> > from the screen I want it to pass. My code is included.
> >> >
> >> > Thanks.
> >> >
> >> > require 'yaml'
> >> > require 'test/unit'
> >> > require 'watir'
> >> >
> >> > require 'myCompany'
> >> > require 'utils'
> >> >
> >> > include COMPANY::Utils
> >> > #load test parameters
> >> > @@ddt = open('data.yml') {|f| YAML.load(f) }
> >> > @@ie = getBrowser(@@ddt['url'])
> >> >
> >> > class DocumentTestScripts < Test::Unit::TestCase
> >> >
> >> >  def setup
> >> >
> >> >
> >> >  @myCompany = COMPANY::MyCompany.new(@@ie)
> >> >
> >> >  end
> >> >
> >> >  def test_9_Bug4986_error_on_dialog_close
> >> >
> >> >@myCompany.loginIssue @@ddt['username'], "aasda" #deliberately
> >> > enter the wrong pwd
> >> >
> >> >if jsToEval = 'Ext.query("div.x-tool")[0].click()' #check for x
> >> > and click if present
> >> >@@ie.document.parentWindow.eval(jsToEval)
> >> >else
> >> >@@ie.button(:text, 'Close').click() #otherwise just click close
> >> >end
> >> >
> >> >#sleep 1 until @@ie.text.!include? "Loading..."
> >> >
> >> >sleep 35
> >> >
> >> >assert(@@ie.div(:text, 'Loading...').exists?)
> >> >
> >> >#Simple pusedo code representaion of what I want to do
> >> >
> >> >#if true
> >> >#puts 'Loading present, test failed'
> >> >#else
> >> >#puts 'Test passed'
> >> >#end
> >> >
> >> >end
> >> >
> >> > end
> >> >
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> Aidy
> >> blog: www.agiletester.co.uk
> >> twitter: http://twitter.com/aidy_lewis
> >>
> >
> >
> >
> > --
> > Jerry
> >
> > >
> >
>
>
>
> --
>  Aidy
> blog: www.agiletester.co.uk
> twitter: http://twitter.com/aidy_lewis
>
> >
>


-- 
Jerry

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Check div for null return

2009-06-03 Thread aidy lewis

The predicate '?' in Ruby indicates that the method returns a Boolean.

The wait_for? method will 'yield' if that block is true.

And then we are asserting whether that block is true or false.

Aidy

2009/6/3 Jerry Lane :
> I am confused as to how you assert the boolean. Is it simply a true or
> false?
>
> 2009/6/3 aidy lewis 
>>
>>  def wait_for?(seconds=0)
>>   slept = 0
>>   until yield || slept == seconds
>>     sleep 0.5
>>     slept += 0.5
>>   end
>>   yield
>>  end
>>
>>
>> boolean = wait_for?(35) { @@ie.div(:text, 'Loading...').exists? }
>> assert(boolean)
>>
>> #you may get more benefit from using Rspec or Cucumber
>>
>> Aidy
>>
>> 2009/6/3 Jer :
>> >
>> > Hi all,
>> > Just wondering can anyone help me with this code. I just want to check
>> > my assert at the finish to see if the value "loading..." is present.
>> > If after 35 seconds it is present I want it to fail, if it is gone
>> > from the screen I want it to pass. My code is included.
>> >
>> > Thanks.
>> >
>> > require 'yaml'
>> > require 'test/unit'
>> > require 'watir'
>> >
>> > require 'myCompany'
>> > require 'utils'
>> >
>> > include COMPANY::Utils
>> > #load test parameters
>> > @@ddt = open('data.yml') {|f| YAML.load(f) }
>> > @@ie = getBrowser(@@ddt['url'])
>> >
>> > class DocumentTestScripts < Test::Unit::TestCase
>> >
>> >  def setup
>> >
>> >
>> >     �...@mycompany = COMPANY::MyCompany.new(@@ie)
>> >
>> >  end
>> >
>> >  def test_9_Bug4986_error_on_dialog_close
>> >
>> >   �...@mycompany.loginissue @@ddt['username'], "aasda" #deliberately
>> > enter the wrong pwd
>> >
>> >    if jsToEval = 'Ext.query("div.x-tool")[0].click()' #check for x
>> > and click if present
>> >    @@ie.document.parentWindow.eval(jsToEval)
>> >    else
>> >    @@ie.button(:text, 'Close').click() #otherwise just click close
>> >    end
>> >
>> >    #sleep 1 until @@ie.text.!include? "Loading..."
>> >
>> >    sleep 35
>> >
>> >    assert(@@ie.div(:text, 'Loading...').exists?)
>> >
>> >    #Simple pusedo code representaion of what I want to do
>> >
>> >    #if true
>> >    #puts 'Loading present, test failed'
>> >    #else
>> >    #puts 'Test passed'
>> >    #end
>> >
>> >    end
>> >
>> > end
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Aidy
>> blog: www.agiletester.co.uk
>> twitter: http://twitter.com/aidy_lewis
>>
>
>
>
> --
> Jerry
>
> >
>



-- 
Aidy
blog: www.agiletester.co.uk
twitter: http://twitter.com/aidy_lewis

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Check div for null return

2009-06-03 Thread Jerry Lane
I am confused as to how you assert the boolean. Is it simply a true or
false?

2009/6/3 aidy lewis 

>
>  def wait_for?(seconds=0)
>   slept = 0
>   until yield || slept == seconds
> sleep 0.5
> slept += 0.5
>   end
>   yield
>  end
>
>
> boolean = wait_for?(35) { @@ie.div(:text, 'Loading...').exists? }
> assert(boolean)
>
> #you may get more benefit from using Rspec or Cucumber
>
> Aidy
>
> 2009/6/3 Jer :
>  >
> > Hi all,
> > Just wondering can anyone help me with this code. I just want to check
> > my assert at the finish to see if the value "loading..." is present.
> > If after 35 seconds it is present I want it to fail, if it is gone
> > from the screen I want it to pass. My code is included.
> >
> > Thanks.
> >
> > require 'yaml'
> > require 'test/unit'
> > require 'watir'
> >
> > require 'myCompany'
> > require 'utils'
> >
> > include COMPANY::Utils
> > #load test parameters
> > @@ddt = open('data.yml') {|f| YAML.load(f) }
> > @@ie = getBrowser(@@ddt['url'])
> >
> > class DocumentTestScripts < Test::Unit::TestCase
> >
> >  def setup
> >
> >
> >  @myCompany = COMPANY::MyCompany.new(@@ie)
> >
> >  end
> >
> >  def test_9_Bug4986_error_on_dialog_close
> >
> >@myCompany.loginIssue @@ddt['username'], "aasda" #deliberately
> > enter the wrong pwd
> >
> >if jsToEval = 'Ext.query("div.x-tool")[0].click()' #check for x
> > and click if present
> >@@ie.document.parentWindow.eval(jsToEval)
> >else
> >@@ie.button(:text, 'Close').click() #otherwise just click close
> >end
> >
> >#sleep 1 until @@ie.text.!include? "Loading..."
> >
> >sleep 35
> >
> >assert(@@ie.div(:text, 'Loading...').exists?)
> >
> >#Simple pusedo code representaion of what I want to do
> >
> >#if true
> >#puts 'Loading present, test failed'
> >#else
> >#puts 'Test passed'
> >#end
> >
> >end
> >
> > end
> >
> > >
> >
>
>
>
> --
> Aidy
> blog: www.agiletester.co.uk
> twitter: http://twitter.com/aidy_lewis
>
> >
>


-- 
Jerry

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Check div for null return

2009-06-03 Thread aidy lewis

 def wait_for?(seconds=0)
   slept = 0
   until yield || slept == seconds
 sleep 0.5
 slept += 0.5
   end
   yield
 end


boolean = wait_for?(35) { @@ie.div(:text, 'Loading...').exists? }
assert(boolean)

#you may get more benefit from using Rspec or Cucumber

Aidy

2009/6/3 Jer :
>
> Hi all,
> Just wondering can anyone help me with this code. I just want to check
> my assert at the finish to see if the value "loading..." is present.
> If after 35 seconds it is present I want it to fail, if it is gone
> from the screen I want it to pass. My code is included.
>
> Thanks.
>
> require 'yaml'
> require 'test/unit'
> require 'watir'
>
> require 'myCompany'
> require 'utils'
>
> include COMPANY::Utils
> #load test parameters
> @@ddt = open('data.yml') {|f| YAML.load(f) }
> @@ie = getBrowser(@@ddt['url'])
>
> class DocumentTestScripts < Test::Unit::TestCase
>
>  def setup
>
>
>     �...@mycompany = COMPANY::MyCompany.new(@@ie)
>
>  end
>
>  def test_9_Bug4986_error_on_dialog_close
>
>   �...@mycompany.loginissue @@ddt['username'], "aasda" #deliberately
> enter the wrong pwd
>
>    if jsToEval = 'Ext.query("div.x-tool")[0].click()' #check for x
> and click if present
>    @@ie.document.parentWindow.eval(jsToEval)
>    else
>    @@ie.button(:text, 'Close').click() #otherwise just click close
>    end
>
>    #sleep 1 until @@ie.text.!include? "Loading..."
>
>    sleep 35
>
>    assert(@@ie.div(:text, 'Loading...').exists?)
>
>    #Simple pusedo code representaion of what I want to do
>
>    #if true
>    #puts 'Loading present, test failed'
>    #else
>    #puts 'Test passed'
>    #end
>
>    end
>
> end
>
> >
>



-- 
Aidy
blog: www.agiletester.co.uk
twitter: http://twitter.com/aidy_lewis

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: XPath and ñ

2009-06-03 Thread Željko Filipin
On Wed, Jun 3, 2009 at 3:36 PM, Andrew  wrote:
> Looks like that fixed it in my initial testing.  Thanks!

I am glad to hear that. :)

I am just surprised that in this day and age we still have to take care of
unicode and stuff like that.

Željko

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: XPath and ñ

2009-06-03 Thread Andrew

Just for the sake of having a complete question/answer, you just need
to add the following two lines to your ruby script:

require “win32ole”
WIN32OLE.codepage = WIN32OLE::CP_UTF8

Source: http://zeljkofilipin.com/2006/03/15/utf-8-and-ruby/

On Jun 3, 9:36 am, Andrew  wrote:
> Looks like that fixed it in my initial testing.  Thanks!
>
> On Jun 3, 9:29 am, Željko Filipin 
> wrote:
>
> > On Wed, Jun 3, 2009 at 3:17 PM, Andrew  wrote:
> > > If the ñ character is anywhere in my html file, it appears to be
> > > breaking the xpath selectors I'm using.
>
> > A long time ago I wrote a blog post that could maybe help you:
>
> >http://zeljkofilipin.com/2006/03/15/utf-8-and-ruby/
>
> > Željko
> > --http://watirpodcast.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: XPath and ñ

2009-06-03 Thread Andrew

Looks like that fixed it in my initial testing.  Thanks!

On Jun 3, 9:29 am, Željko Filipin 
wrote:
> On Wed, Jun 3, 2009 at 3:17 PM, Andrew  wrote:
> > If the ñ character is anywhere in my html file, it appears to be
> > breaking the xpath selectors I'm using.
>
> A long time ago I wrote a blog post that could maybe help you:
>
> http://zeljkofilipin.com/2006/03/15/utf-8-and-ruby/
>
> Željko
> --http://watirpodcast.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: XPath and ñ

2009-06-03 Thread Andrew

Thanks, I'll check that out.

On Jun 3, 9:29 am, Željko Filipin 
wrote:
> On Wed, Jun 3, 2009 at 3:17 PM, Andrew  wrote:
> > If the ñ character is anywhere in my html file, it appears to be
> > breaking the xpath selectors I'm using.
>
> A long time ago I wrote a blog post that could maybe help you:
>
> http://zeljkofilipin.com/2006/03/15/utf-8-and-ruby/
>
> Željko
> --http://watirpodcast.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: XPath and ñ

2009-06-03 Thread Željko Filipin
On Wed, Jun 3, 2009 at 3:17 PM, Andrew  wrote:
> If the ñ character is anywhere in my html file, it appears to be
> breaking the xpath selectors I'm using.

A long time ago I wrote a blog post that could maybe help you:

http://zeljkofilipin.com/2006/03/15/utf-8-and-ruby/

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: forms in subframes - elements not found

2009-06-03 Thread aidy lewis

> ff.frame(:index, 1).form(:name, "lay0803234_src350a").select_list(:id,
> "LOV6") .inspect

Try :index, 0

Aidy

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Check div for null return

2009-06-03 Thread Jer

Hi all,
Just wondering can anyone help me with this code. I just want to check
my assert at the finish to see if the value "loading..." is present.
If after 35 seconds it is present I want it to fail, if it is gone
from the screen I want it to pass. My code is included.

Thanks.

require 'yaml'
require 'test/unit'
require 'watir'

require 'myCompany'
require 'utils'

include COMPANY::Utils
#load test parameters
@@ddt = open('data.yml') {|f| YAML.load(f) }
@@ie = getBrowser(@@ddt['url'])

class DocumentTestScripts < Test::Unit::TestCase

  def setup


  @myCompany = COMPANY::MyCompany.new(@@ie)

  end

  def test_9_Bug4986_error_on_dialog_close

@myCompany.loginIssue @@ddt['username'], "aasda" #deliberately
enter the wrong pwd

if jsToEval = 'Ext.query("div.x-tool")[0].click()' #check for x
and click if present
@@ie.document.parentWindow.eval(jsToEval)
else
@@ie.button(:text, 'Close').click() #otherwise just click close
end

#sleep 1 until @@ie.text.!include? "Loading..."

sleep 35

assert(@@ie.div(:text, 'Loading...').exists?)

#Simple pusedo code representaion of what I want to do

#if true
#puts 'Loading present, test failed'
#else
#puts 'Test passed'
#end

end

end

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] XPath and ñ

2009-06-03 Thread Andrew

If the ñ character is anywhere in my html file, it appears to be
breaking the xpath selectors I'm using.  Here's an example of what I'm
running into.

If I have the following html file:








Español




And use this selector:

x = ie.hidden(:xpath, "//inp...@name='name1']")

x.exists? will return this error:

irb(main):203:0> x.exists?
REXML::ParseException: # >
C:/Ruby/lib/ruby/1.8/rexml/parsers/baseparser.rb:330:in `pull'
C:/Ruby/lib/ruby/1.8/rexml/parsers/treeparser.rb:22:in `parse'
C:/Ruby/lib/ruby/1.8/rexml/document.rb:205:in `build'
C:/Ruby/lib/ruby/1.8/rexml/document.rb:42:in `initialize'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
713:in `new'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
713:in `create_rexml_document_object'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
693:in `rexml_document_object'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
897:in `elements_by_xpath'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:
890:in `element_by_xpath'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/container.rb:
730:in `locate_input_element'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/input_elements.rb:
5:in `locate'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:273:in
`exists?'

(irb):203:in `irb_binding'
C:/Ruby/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
:0
...
Missing end tag for 'div' (got "body")
Line:
Position:
Last 80 unconsumed characters:
 
Line:
Position:
Last 80 unconsumed characters:
 
from C:/Ruby/lib/ruby/1.8/rexml/parsers/treeparser.rb:92:in
`parse'
from C:/Ruby/lib/ruby/1.8/rexml/document.rb:205:in `build'
from C:/Ruby/lib/ruby/1.8/rexml/document.rb:42:in `initialize'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
class.rb:713:in `new'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
class.rb:713:in `create_rexml_document_object'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
class.rb:693:in `rexml_document_object'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
class.rb:897:in `elements_by_xpath'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-
class.rb:890:in `element_by_xpath'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
container.rb:730:in `locate_input_element'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
input_elements.rb:5:in `locate'
from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/
element.rb:273:in `exists?'
from (irb):203
from :0

However, if I remove the ñ and use the same selector, x.exists? will
return true.  I haven't found anything about this issue on the
internet or in this newsgroup.  Is this a known bug and is there a
workaround?  Or am I just missing something?

Thanks for your help!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: forms in subframes - elements not found

2009-06-03 Thread jason

Chuck, thanks a million for the feedback.

This seems to be problem with firewatir. The following works fine.

url = "http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/
jobboerse.aspx"
ff = FireWatir::Firefox.new
ff.goto(url)
ff.frame(:index, 1).form(:name, "lay0803234_src350a").inspect

This does not:

url = "http://www.siemens.de/jobs/jobs_bewerbung/jobboerse/Seiten/
jobboerse.aspx"
ff = FireWatir::Firefox.new
ff.goto(url)
ff.frame(:index, 1).form(:name, "lay0803234_src350a").select_list(:id,
"LOV6") .inspect

which results in the following error:
MozillaBaseElement.rb:973:in `assert_exists': Unable to locate
element, using :id, "LOV6" (Watir::Exception::UnknownObjectException)

I had a look at the firewatir code and see this in the
locate_tagged_element method which is total crap because if the
container class is not a frame then the search of the object will
default to the base document and not the frame!! which of course
explains why it is not working.

if(@container.class == FireWatir::Firefox || @container.class ==
Frame)
  jssh_command += "var elements_#{tag} = null; elements_#{tag} = #
{DOCUMENT_VAR}.getElementsByTagName(\"#{tag}\");"

Totally, totally rubbish and makes firewatir vertually unuseable for
anyone exploring forms within frames.
and even more unfortunate is the fact that i cannot use IE because I
am in a unix environement.

bugger, bugger, bugger.






On 2 Jun., 20:33, Chuck van der Linden  wrote:
> On May 29, 7:58 am, jason  wrote:
>
> > Michael, thanks for the feedback. as mentioned above that works fine -
> > however is not much use becasue the select list has no relationship to
> > the form that contains it.
>
> no, but it would be the correct list (unless your devs are abusing
> hml) since there is only one instance of that ID allowed, so it would
> be selecting the corrrect selection list.
>
> This seems perhaps to be something limited to Firewatir however..
> since with Watir and IE7 as my browser I'm able to perform the
> function you indicated
>
> >> browser.frame(:index, 1).form(:name, 
> >> "lay0803234_src350a").select_list(:id, "LOV6")
>
>  without a problem.
>
> One thing to check, use .show_frames  and make sure you have the right
> one.  with IE it's index 1 for the frame you want.  There is another
> frame on the page but that's index 2.  I'm not sure if it's possible,
> but maybe good to check that the order is still the same in FF.
>
> Can you do it from IRB or a watircraft console, and see if you can
> flash the form ?
>  browser.frame(:index, 1).form(:name, "lay0803234_src350a").flash
>  that would tell you if you have the right container. for the list and
> can address it.
>
> Not sure if it helps to know I can't duplicate your issue when using
> IE, but there it is.  your code is, in theory anyway (once we
> eliminate the "index" for ":index" typo), sound.  so I'd think it
> ought to work with FF as well as with IE
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Need help on jssh installation for firefox

2009-06-03 Thread Chethan

Pls Help me out on this Jssh issue.

Thanks,
Chethan

On Jun 3, 9:54 am, Chethan  wrote:
> Yes I am admin user for the machine i am using.
>
> Here are the steps i followed.
> 1. browse tohttp://wtr.rubyforge.org/
> 1. Installed Ruby fromhttp://rubyforge.org.
> 2. from command prompt entered "gem update --system"
> 3. then entered "gem install watir"
> 4. installed firefox add-on Jssh from the wtr.rubyforge.org site
> 5. run manually C:\Program Files\Mozilla Firefox>firefox.exe -jssh
> 6 checked for Jssh port by telnet localhost 9997
>
> Following error was seen "Connecting To localhost...Could not open
> connection to the host, on port 9997: C
> onnect failed"
>
> I am using windows XP(sp2) firefox version is 3.0.10 & jssh version is
> 0.9
>
> Thanks,
> Chethan
>
> On Jun 2, 6:10 pm, Angrez Singh  wrote:
>
> > Are you an admin user on your machine? I use Firewatir a lot on my machine
> > (Windows XP SP2) with Firefox 3.0.10) and never faced any problem with jssh.
>
> > - Angrez
>
> > On Tue, Jun 2, 2009 at 6:04 PM, Chethan  wrote:
>
> > > Yes I installed Jssh plug in but if i do telnet localhost 9997 it say
> > > there is no service running on 9997 port. That is what i described in
> > > my earlier mails.
>
> > > Thanks,
> > > Chethan
>
> > > On Jun 2, 5:30 pm, jason  wrote:
> > > > did you install the jssh firefox plugin???
>
> > > > On 2 Jun., 14:05, Chethan  wrote:
>
> > > > > I installed the Firewatir with new method rather then "gem install
> > > > > firewatir" command, I done that through "gem install watir" online how
> > > > > the new Watir overview describes.
>
> > > > > Thanks,
> > > > > Chethan
>
> > > > > On Jun 2, 3:04 pm, Chethan  wrote:
>
> > > > > > Hi,
>
> > > > > > I am using window-Xp(sp2) & my Firefox version is 3.0.10.
>
> > > > > > Rgds,
> > > > > > Chethan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: example problem

2009-06-03 Thread aidy lewis

Chuck,

Your comments are highly simplistic: We still have differences with
list based indexes; Watir being one based and Firewatir zero based
(as Watir wraps OLE and FireWatir, javascipt), the text representation
of the HTML (browser.text), #click_no_wait, and to my knowledge
parallelism.

Aidy

2009/6/2 Chuck van der Linden :
>
> To be more clear, the current version of Watir has integrated in the
> Firewatir driver..  so you get both Watir and Firewatir when you
> install it.
>
> Most functions are pretty much equally supported on both browsers.
> and the way things work you now institute an instance of 'browser'
> which can be either IE or FF, and call most of your methods against
> that.
>  (see http://wiki.openqa.org/display/WTR/Browser.new)
>
> The nice thing is that now I have scripts that do things like:
> browser.link(:text, "clickme").click   and they can be developed
> against either IE or FireFox, and then quickly switched (via a few
> different methods depending on what works best for you) to run against
> the other browser.
>
> not all of the tutorial and sample code has caught up to the new
> paradigm, so you will see a lot of code there, and also posted here,
> where people will write 'ie.method..'  and 'ff.method...'    but now
> adays we'd typically say 'browser.method' (and some will shorten that
> to bro.method, or br, or just b  (although there's a bit of a
> preference style wise among ruby programmers to only use single letter
> variables for iterators) )
>
> Hopefully that eliminates a bit of the confusion instead of just
> causing more.
>
>
>
> On May 30, 10:55 pm, James  wrote:
>> ok completely new to the world of ruby as well as programming
>>       The final goal is too scrape an ajax site... if I understand
>> currently I need both watir and firewatir?
>> I am trying to go through some online examples and am trying to
>> complete the google_search.rb example that seems to be floating
>> around.
>>
>> I don't think the program is running properly when I  
>> require "watir"
>>      because I get the error      google_search.rb:14:in
>> `require': no such file to load -- watir (LoadError)
>>
>> any idea what this means? I am running windows xp
>>
>> thanks for the help in advance
> >
>



-- 
Aidy
blog: www.agiletester.co.uk
twitter: http://twitter.com/aidy_lewis

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: pls help; Enter data in textbox

2009-06-03 Thread Wesley Chen
I don't need use focus, it works.

I think you are in a frame.
Please try ie.frame(:).text_field( ).set( )

Thanks.
Wesley Chen.


On Wed, Jun 3, 2009 at 2:57 PM, Krishna saradka
wrote:

> Kiran,
>
> I just tried the same and it worked perfectly fine from here. Attached the
> html & .rb file for ref.
> I suspect there are some more parameters invovled in this case, which might
> be impacting the script when you run from your end. Can check out more if
> you can share the entire html file.
>
> Thanks & regards,
> KK
>
> On Wed, Jun 3, 2009 at 12:04 PM, KiranD  wrote:
>
>>  Hi Guys
>>
>>
>>
>> I am trying to enter some text in the textbox through Watir ,
>>
>> but it is not able to enter text directly in the textbox until I click on
>> web page area.
>>
>>
>>
>> When I click on any where on the page area then it shows description
>> string in Textbox.
>>
>> I used set focus method but still it has a problem.
>>
>>
>>
>> I have to data driven testing.  help me to resolve this
>>
>> Here is the piece of code that I used.
>>
>>
>>
>>
>>
>> ie.bring_to_front()
>>
>> ie.text_field(:id,"short_desc").focus()
>>
>> ie.text_field(:id,"short_desc").set "Description"
>>
>>
>>
>>
>>
>> 
>>
>> Description: 
>>
>> 
>>
>>    
>>
>> > style="width:500px; display:none;">
>>
>> > class="txt" size="100" maxlength="200" />
>>
>>    
>>
>>  
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Best regards,
>>
>> KiranD
>>
>>
>>
>>
>>
>>
>> >>
>>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: override js confirm FireWatir

2009-06-03 Thread aidy lewis

Chuck

2009/6/2 Chuck van der Linden :
>
> Have you reviewed the general info on the types of popups and how to
> handle them?  http://wiki.openqa.org/display/WTR/Pop+Ups
>

The aim was to override the js confirm function without using wsh or
the autoit wrapper that is shown in these examples, which I have
successfully accomplished in IE using the execScript method.


Aidy

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to detect the a mouseover popup?

2009-06-03 Thread Ivan Chung

I just need a value returned, lets say the popup works then return
"true" and vice versa.

On Jun 3, 4:36 pm, Ivan Chung  wrote:
> Hi all,
>
> I have scenario which i needed to detect the presence of a javascript
> popup when mouse over the navigations. How could i do this?
>
> Any helps are appreciated.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to detect the a mouseover popup?

2009-06-03 Thread Željko Filipin
On Wed, Jun 3, 2009 at 10:36 AM, Ivan Chung  wrote:
> I have scenario which i needed to detect the presence of a javascript
> popup when mouse over the navigations.

Maybe this will help:

http://wiki.openqa.org/display/WTR/JavaScript
http://wiki.openqa.org/display/WTR/Pop+Ups


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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] How to detect the a mouseover popup?

2009-06-03 Thread Ivan Chung

Hi all,

I have scenario which i needed to detect the presence of a javascript
popup when mouse over the navigations. How could i do this?

Any helps are appreciated.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---