[wtr-general] Re: Browser.url does not return proper URL immediately after a browser.goto statement

2009-04-08 Thread Jarmo Pertman

Hi.

Actually, it doesn't matter if () or {} is used. You just have to use
some non-alpha character - for example, let's say that you want to add
elements like {one {two {three then you cannot use %w{}, but it would
be wise to use %w() instead.

Anyway, here are some examples:
irb(main):004:0 %w(one two three)
= [one, two, three]
irb(main):005:0 %w{one two three}
= [one, two, three]
irb(main):007:0 %w%one two three%
= [one, two, three]
irb(main):008:0 %w!one two three!
= [one, two, three]

As you can see, they all return same arrays. It's same as using %q or
%Q for strings, that it is up to the developer, which character to use
for string start and end.

So, like:
irb(main):009:0 str = %q(this is a string with some  and '
characters, but it works fine)
= this is a string with some \ and ' characters, but it works fine

Cheers,
Jarmo

On Mar 26, 6:50 pm, George george.sand...@gmail.com wrote:
 Hi Kevin,

 I did a quick check...I think you just need whitespace, not quotes to
 separate your data using w{}.  You'll also need to use {} instead of
 ().

 -George

--~--~-~--~~~---~--~~
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: Browser.url does not return proper URL immediately after a browser.goto statement

2009-03-26 Thread Kevin White

Let me comment on my own post with an example. I might be having a
Ruby problem and not a Watir problem. Here is what I am trying to do:


require 'watir'

Watir::Browser.default = 'firefox'
browser = Watir::Browser.new

sites = %w(www.google.com www.yahoo.com www.microsoft.com)

sites.each do

  |url|

  puts going to website: #{url}
  browser.goto(url)

  puts Browser went to:  #{browser.url}

end




On Mar 26, 10:46 am, Kevin White ilium...@gmail.com wrote:
 I'm trying to test that a web application always redirects back to a
 login page if you try to go to one of the application's pages when
 you're not logged in.

 First, I do:

 browser.goto(http://www.pagethatredirects.com;)

 Then, I look at the contents of @browser.url and I get about: blank,
 which is what my firefox install opens up to.

 From what I've read, Watir/firewatir should be waiting until the page
 is loaded before executing the browser.url statement. I'm basing that
 on:http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir

 However, that isn't really working the way I expect. Should I be using
 wait_until?
--~--~-~--~~~---~--~~
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: Browser.url does not return proper URL immediately after a browser.goto statement

2009-03-26 Thread Kevin White

Yep, that was exactly it! I ended up getting a debugger going and
found out that my strings had double quotes. I must've misread
something when looking up how to do this...

Thanks!

--Kevin

On Mar 26, 11:55 am, George george.sand...@gmail.com wrote:
 This worked for me:

 require 'watir'
 Watir::Browser.default = 'firefox'
 browser = Watir::Browser.new
 sites = %w{www.google.comwww.yahoo.comwww.microsoft.com}
 sites.each do
   |url|
   puts going to website: #{url}
   browser.goto(url)
   puts Browser went to:  #{browser.url}
 end

 On Mar 26, 8:50 am, George george.sand...@gmail.com wrote:

  Hi Kevin,

  I did a quick check...I think you just need whitespace, not quotes to
  separate your data using w{}.  You'll also need to use {} instead of
  ().

  -George

  On Mar 26, 8:01 am, Kevin White ilium...@gmail.com wrote:

   Let me comment on my own post with an example. I might be having a
   Ruby problem and not a Watir problem. Here is what I am trying to do:

   require 'watir'

   Watir::Browser.default = 'firefox'
   browser = Watir::Browser.new

   sites = %w(www.google.com www.yahoo.com www.microsoft.com)

   sites.each do

     |url|

     puts going to website: #{url}
     browser.goto(url)

     puts Browser went to:  #{browser.url}

   end

   On Mar 26, 10:46 am, Kevin White ilium...@gmail.com wrote:

I'm trying to test that a web application always redirects back to a
login page if you try to go to one of the application's pages when
you're not logged in.

First, I do:

browser.goto(http://www.pagethatredirects.com;)

Then, I look at the contents of @browser.url and I get about: blank,
which is what my firefox install opens up to.

From what I've read, Watir/firewatir should be waiting until the page
is loaded before executing the browser.url statement. I'm basing that
on:http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir

However, that isn't really working the way I expect. Should I be using
wait_until?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---