Hi,

The test I am writing needs two browser instances to test session
management, the problem is once I've been working in the second
browser instance I cannot find a link in the first instance.


I have defined my test case as,

    def testLogin4
        #Test session exists condition, cancel login
        $log.debug "===testLogin4==="
        #Login First Session
        browserOne = Watir::Browser.start($myPAR.url)
        sessionOne = Login.new(browserOne,$myPAR.user,$myPAR.password)
        checkLogin(browserOne)
        #Login Second Session
        browserTwo = Watir::Browser.start($myPAR.url)
        sessionTwo = Login.new(browserTwo,$myPAR.user,$myPAR.password)
        #Check Session Exists Warning
        myElements = CSVRead.new("data/
testLoginDialogElements.csv").array
        checkElements(browserTwo,myElements)
        browserTwo.button(:id,"ws-dialog-cancel").click
        #Check dropped back to the login screen
        myElements = CSVRead.new("data/loginElements.csv").array
        checkElements(browserTwo,myElements)
        #Check original session okay
        assert(browserOne.link(:id,"ws-logout").exists?)
        sessionOne.Logout(browserOne)
        browserOne.close
        browserTwo.close
        $log.debug "===testLogin4==="
    end

This work okay up until the line assert(browserOne.link(:id,"ws-
logout").exists?) which the script doesn't find.
Is there something I need to do to switch "focus" back to the first
browser session?

TIA
Alastair

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to