Support Requests item #1114230, was opened at 2005-02-01 20:55
Message generated for change (Settings changed) made by henryju
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1114230&group_id=61302

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
Priority: 5
Private: No
Submitted By: Dave Olson (ogeodave)
Assigned to: Nobody/Anonymous (nobody)
Summary: Window.open Fails 

Initial Comment:
I am getting an error when I try to use window.open in 
JWebUnit with a link.  The link is as follows:

<a href="#" onclick="window.open('preCaseSearch.do?
dispatch=display','_blank','toolbar=0,location=0,directories
=0,status=0,menubar=0,scrollbars=0,resizable=1,width=9
00,height=600,left=80,top=80');">Case Search</a>

I haven't been able to find an example on how to handle 
window.opens on JWebUnit.  Does anyone know of one?  
When I call the JWebUnit method clickLinkWithText
("Case Search"), the above link causes the following 
program exception and stack trace:  

Excp:java.lang.RuntimeException: 
java.lang.RuntimeException: Event 'window.open
('preCaseSearch.do?
dispatch=display','_blank','toolbar=0,location=0,directories
=0,status=0,menubar=0,scrollbars=0,resizable=1,width=9
00,height=600,left=80,top=80');' failed: 
org.mozilla.javascript.JavaScriptException: 
com.meterware.httpunit.ScriptException: 
Script 'window.resizeTo(900,300);

function selectCaseStatus(theForm, theList) {
    for (i = 0; i < theList.length; i++) {
        if(theList.options[i].value == 
theForm.cs_CaseStatusCode.value) {
            theList.selectedIndex = i
        }
    }
}

function clearForm(aForm) {
    aForm.cs_AccountNumber.value = ""
    aForm.cs_DisputeAmount.value = ""
    aForm.cs_AccountFirstName.value = ""
    aForm.cs_TransactionAmount.value = ""
    aForm.cs_AccountLastName.value = ""
    aForm.cs_TransactionID.value = ""
    aForm.cs_AcquirerReferenceNumber.value = ""
    aForm.cs_TransactionDate.value = ""
    aForm.cs_MerchantName.value = ""
    aForm.cs_WorkCaseNumber.value = ""
    aForm.cs_MerchantNumber.value = ""
    aForm.cs_CaseStatus.selectedIndex = 0   
}

function submitPopup(caseId){
    
    document.caseSearchForm.cs_CaseID.value = caseId;
    
document.caseSearchForm.dispatch.value="workcase";

    var queryString = "?dispatch=workcase";
    queryString = queryString + "&cs_CaseID=" + 
document.caseSearchForm.cs_CaseID.value;
    window.opener.location = "postCaseSearch.do" + 
queryString;
    return true;
}

function do_navigate(caseId) {
    document.caseSearchForm.cs_CaseID.value = caseId;
    
document.caseSearchForm.dispatch.value="workcase";
    document.caseSearchForm.submit();
}' failed: TypeError: resizeTo is not a function. 
(httpunit; line 716)
        at 
com.meterware.httpunit.javascript.JavaScript$JavaScript
Engine.handleScriptException(JavaScript.java:199)
        at 
com.meterware.httpunit.javascript.JavaScript$JavaScript
Engine.performEvent(JavaScript.java:175)
        at 
com.meterware.httpunit.scripting.ScriptableDelegate.doE
vent(ScriptableDelegate.java:56)
        at 
com.meterware.httpunit.WebRequestSource.submitReque
st(WebRequestSource.java:232)
        at com.meterware.httpunit.WebLink.click
(WebLink.java:98)
        at 
net.sourceforge.jwebunit.HttpUnitDialog.submitRequest
(HttpUnitDialog.java:573)
        at 
net.sourceforge.jwebunit.HttpUnitDialog.clickLinkWithText
(HttpUnitDialog.java:655)
        at 
net.sourceforge.jwebunit.WebTester.clickLinkWithText
(WebTester.java:885)
        at 
net.sourceforge.jwebunit.WebTestCase.clickLinkWithText
(WebTestCase.java:359)
        at 
AcceptanceFixtures.JWebUnit.LoginWebTestCase.testLogi
n(LoginWebTestCase.java:29)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke
(Method.java:324)
        at junit.framework.TestCase.runTest
(TestCase.java:154)
        at junit.framework.TestCase.runBare
(TestCase.java:127)
        at junit.framework.TestResult$1.protect
(TestResult.java:106)
        at junit.framework.TestResult.runProtected
(TestResult.java:124)
        at junit.framework.TestResult.run
(TestResult.java:109)
        at junit.framework.TestCase.run
(TestCase.java:118)
        at junit.framework.TestSuite.runTest
(TestSuite.java:208)
        at junit.framework.TestSuite.run
(TestSuite.java:203)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1114230&group_id=61302

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to