Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2011
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to recognise/get current window

    Presently am using below code, and it is showing an error message says "Cannot call method "getCurrentWindow" of undefined (<Unknown source>#4) in <Unknown source> at line number 4"

    =========================================
    function insertDataIntoHtmlEditorIE()
    {

    currentwindow = this.browserbot.getCurrentWindow(this);

    var iFrame = currentwindow.getElementById

    ('ctl00_MainContent_editor_ctl02_ctl00');

    var iFrameBody;

    iFrameBody =

    iFrame.contentWindow.document.getElementsByTagName('body')[0];

    iFrameBody.innerHTML = "xyz";

    }
    ================================================

    please help me out to resolve this issue..
    *am calling this script in Selenium RC through Eclipse

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    You haven't defined this.browserbot inside that function? Are you sure that it exists?
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •