[Wtr-general] Joining two variables

Paul Carvalho tester.paul at gmail.com
Tue Oct 3 17:27:10 EDT 2006


Hello Astha, you would do it in Ruby just about exactly as you have
suggested.

I would suggest a minor change to your data content though.  You should
either remove the final slash (/) from the first variable, or the first
slash from the second.  Otherwise your built-up URL will look like:

  $about_url = 'http://www.google.com//intl/en/about.html'     # the
double-slash in the middle is undesirable

Whenever you have doubt or want to play with some ideas, give them a try at
the Interactive Ruby (IRB) prompt.

Cheers.  Paul C.


On 03/10/06, Astha Raj <forum-watir-users at openqa.org> wrote:
>
> Hi All,
>
> This is what I want to do. I want the base URL of the site to be a
> variable and to get other pages, I could create varaibles attaching to the
> base. So that if I have to change the URL, I can simply change the base
> variable.
>
> Is there any way I can do this – something like below?
>
> $base_url = 'http://www.google.com/'
> $about_url = $base_url + '/intl/en/about.html'
>
> Thanks for your help.
> Astha
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061003/e90bb563/attachment.html 


More information about the Wtr-general mailing list