Hello, John,

If you're not comfortable with installing another library, you could use
standard Ruby functions to achieve it.

p @url.split("/").last.split("&").first.gsub("index?ticket=", "")

It's ugly and could break, so don't rely on it :)

Good luck,

FK

On Thu, Apr 29, 2010 at 2:33 PM, John Williams <[email protected]> wrote:

> Thanks, Felipe. I'll give that a try. I was curious if there are any
> native methods in Watir I could use, like xpath?
>
> Cheers,
> John
>
> On Apr 29, 9:57 am, Felipe Knorr Kuhn <[email protected]> wrote:
> > Hello, John,
> >
> > You can use the Addressable library (http://addressable.rubyforge.org/
>  or
> > gem install addressable ) then use the following:
> >
> > @url = Addressable::URI.parse(@ie.url)
> >
> > @ticket = @url.query_values["ticket"]
> >
> > p @ticket
> >
> > Hope that helps,
> >
> > FK
> >
> >
> >
> >
> >
> > On Thu, Apr 29, 2010 at 1:35 PM, John Williams <[email protected]>
> wrote:
> > > I'm using Watir in IE to test a website where many URLs are
> > > dynamically generated with a unique ticket parameter. How do I grab
> > > this ticket parameter from the URL once I get to the page?
> >
> > > For example, when I use Watir to go to a URL like:
> >
> > >http://www.mydomain.com
> >
> > > I end up on a page with dynamically generated parameters like this:
> >
> > >http://www.mydomain.com/index?ticket=86aa224f8ac26fd9543075f992c29f1c.
> ..
> >
> > > How do I get this dynamcially generated URL so that I can put together
> > > and go to additional dynamically generated URLs using the same ticket
> > > parameter?
> >
> > > Thanks,
> > > John
> >
> > > --
> > > Before posting, please readhttp://watir.com/support. In short: search
> > > before you ask, be nice.
> >
> > > You received this message because you are subscribed to
> > >http://groups.google.com/group/watir-general
> > > To post: [email protected]
> > > To unsubscribe: 
> > > [email protected]<watir-general%[email protected]>
> <watir-general%2bunsubscr...@goog­legroups.com>
> >
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> before you ask, be nice.
> >
> > You received this message because you are subscribed tohttp://
> groups.google.com/group/watir-general
> > To post: [email protected]
> > To unsubscribe: [email protected] Hide quoted
> text -
> >
> > - Show quoted text -
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> You received this message because you are subscribed to
> http://groups.google.com/group/watir-general
> To post: [email protected]
> To unsubscribe: 
> [email protected]<watir-general%[email protected]>
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

Reply via email to