Say we have two html pages in which one embeds the other in a frame.
```html
<!-- test.html -->
<html>
        <p>Test Page</p>
        <p><iframe id="embeddedFrame" class="seamless" src="embed.html" 
width="1000" height="560" frameBorder="0" scrolling="no">
        <p><Your browser does not support iframes.</p>
        </iframe></p>
</html>
```
and 
```html
<!-- embed.html -->
<html>
        <div id="someID">
                <p> Test Embed Page </p>
        </div>
</html>
```
Then I run the following script
```ruby
require 'watir-webdriver'
browser = Watir::Browser.start("test.html")
embed_frame = browser.frame(:id, "embeddedFrame")
embed_frame.div(:id, "someID").exists?
puts browser.url
```
I expect to still be in the `test.html` page, but the actual result is 
`embedded.html`

Then while I was debugging on why the url is changed, I ran the following after 
the previous script:
```ruby
browser.windows[0].url
puts browser.url
```
The browser's url then changes back to the expected url of `test.html`
My current fix is to just do
```ruby
browser.windows[0].use
```

Is this the expected behavior?


---
Reply to this email directly or view it on GitHub:
https://github.com/watir/watir-webdriver/issues/205
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to