Forwarding it to the list

---------- Forwarded message ----------
From: elvuel chen
Date: Mon, Sep 20, 2010 at 8:38 AM
Subject: firewatir attach isssue


Hi,

I got problem with firewatir pop window.
After 'click' popup the window.
I try to update the page(popup.html) div(:id,"pop_win") tag's text
with the page(popup_win.html) content, then i got a error message :
document.getElementById("pop_win") is null

env:
mac os: 10.4.11
firefox: 3.6.10
commonwatir: 1.6.5
firewatir: 1.6.5
ruby: 1.8.7 p299

test code:
      @browser = FireWatir::Firefox.new
      @browser.goto("http://localhost:3000/welcome/popup";)
      @browser.link(:text, 'open new window').click
      ff_new = FireWatir::Firefox.attach(:url,
"http://localhost:3000/popup_win.html";)
      
@browser.js_eval("document.getElementById('pop_win').innerText='#{ff_new.text}'")

after inspect
     before attach : @browser.inspect =>
#<FireWatir::Firefox:0x2598380 url="" title="popup">
     after attach :  @browser.inspect =>
#<FireWatir::Firefox:0x2598380 url="" title="intro">

attach doesn't return a new browser object

      #popup.html content:
      <script type="text/javascript">
function op() {
    window.open('/popup_win.html', 'newwindow', 'height=100,
width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no,
resizable=no,location=n o, status=no');
}
</script>
<div id="pop_win">init</div>
<a href="#" onclick="op();">open new window</a>
      #/popup_win.html content
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title>intro</title>
  </head>
  <body>
    Here,pop content.
  </body>
</html>

best regards
elvuel

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

Reply via email to