Use a regular expression. Assuming that the URL is
"http://www.mysite.com/client/abcde012345":
browser.url.match(%r{/client/(.*)})[1]
=> "abcde012345"
From: Lorraine Botros <[email protected]>
To: [email protected]
Sent: Tuesday, June 16, 2015 4:24 PM
Subject: [wtr-general] Code suggestions on how to get a guid from an href to
be used to append to other hrefs.
The site I am automating creates a unique guid when a new client is created so
I will see something like http://www.mysite.com/client/abcde012345 where
'abcde012345 is the unique identifier for that client. I want to get that value
and use it to append to another link such as
http://www.mysite.com/client/profile/abcde012345
I am a newbie to coding so any help or suggestions on good sites to find
examples is greatly appreciated.--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.