Can URI retrieve the URL of a webpage when its open?

A

Arti Singh

Can I use uri to get the URL Of a web page?
I am opening a webapge by clicking on a link and I am flipping to this
new window after I have gotten the handle, I attach to the window after
attaching to this window, I want to use rio to save the webpage to a
file since I need to check it. I can not depend on having a static URL
since the system under test generates URLs dynamically

1 $ms=Watir::IE.attach:)title, htmlemailname)
2 rio($ms)>rio("C://TestResult//index.html")

Line 2 fails cause I think that rio wants

rio("www.webpage.com")>rio("C://TestResult//index.html")


Is there any way to get the URL of a webpage once it is opened?
 
A

Arti Singh

__ __ said:
require 'watir'
w = Watir::IE.new
u = 'http://somesitewithredirection.com'
w.goto(u)

puts w.document.URL

This bit won't work since I dont know the URL,its dynamic. I am
attaching to the window because I know the title and then I get the
window handle and I interact with the window. but you have given me an
idea cause I can get the URL after I have the handle.


Thanks!!!!
Arti
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top