Re: Problems with IFrames

"Wolfgang Fahl - BITPlan" <[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Organization bitplan GmbH
Message-ID <[email protected]>
Dear Allwyn,

I'd like to continue to work on your problem. Could you please
change your javascript code a bit to access the values in a more step wise 
manner and try alternatives?

E.g.  instead of
document.loginForm.password.value 

something like
	lf=document.loginForm;
	pw=lw.password
	vl=pw.value

would help debugging.
An alternative could be
	lf=document.getElementById("loginFormId")

I'm not to familiar with the JavaScript syntax that's why I'm not doing 
this myself. If you consider the problem worthwile pursuing then please 
file a bug report with 
https://sourceforge.net/tracker/index.php?group_id=6550&atid=106550

Yours
   Wolfgang


From:	Allwyn D'souza <[email protected]>
To:	Discussion of use and development of HttpUnit <httpunit-
[email protected]>
Date sent:	Tue, 25 Mar 2008 11:21:51 +0000
Subject:	Re: [Httpunit-develop] Problems with IFrames
Send reply to:	Discussion of use and development of HttpUnit <httpunit-
[email protected]>
	<httpunit-develop.lists.sourceforge.net>
	<mailto:[email protected]?subject=unsubscribe>
	<mailto:[email protected]?subject=subscribe>

> 
> No, not really. No error message if i load the lower frame and set the form values (username and password) and then submit the form. It seems like it keep loading the same page. Does not load the page that should display after the user is logged in.
>  
> Is there something im doing wrong?
>  
> Following is the code snippet of various pages.
>  
> //Login.html (main page that is loaded - this page embed the IFrame).
>  
> <html><Head><Script><!--
> function SetLoginForm(name, password, Submit) {  document.loginForm.name.value = name;  document.loginForm.password.value = password;   document.loginForm.submit();}--></Script></Head>
> <Body><Form name="loginForm" action="/LoginController" method="Post">
> <input type="hidden" name="name" value="" /><input type="hidden" name="password" value="" /></Form>
> <Center><IFrame name="login" id="login" src="LoginDialog.html" /></Center></Body>
> </html>
>  
> // LoginDialog.html - IFrame
>  
> <html><Head><Script><!--
> function SubmitToParent(action) {  parent.SetLoginForm(document.submit_to_parent.name.value,document.submit_to_parent.password.value);
> }--></Script></Head>
> <Body><Form id=f1 name="submit_to_parent" method="Post">
> <input type="text" name="name" value="" /><input type="text" name="password" value="" />
> <input type="submit" name="Ok" value="login" onClick="SubmitToParent('Submit')" /></Form>
> </Body>
> </html>
>  
> // Login.java - HttpUnit Testcase
> public void testLogin() {
>   this.response = conversation.getCurrentPage()'  WebResponse bottomFrame = conversation.getFrameContents("login"); // load the <Iframe>  WebForm form = bottomFrame.getFormWithName("submit_to_parent");  form.setParameter("user","aa");  form.setParameter("password","xx");  this.response = form.submit(); // This response contains the same page, does not log the user in. Load the same //page}
>  
> Thanks.
>  
> Regds,
>  
> Al.  
> 
> 
> Date: Sun, 23 Mar 2008 13:22:01 -0400From: [email protected]: [email protected]: Re: [Httpunit-develop] Problems with IFrames
> Are you getting any error messages?On Mar 21, 2008, at 10:56 AM, Allwyn D'souza wrote:
> 
> Hi Guys, Im using HttpUnit to write test cases. My web application uses <Iframes> to login to the application.  To simplify, i have a login page. This page has a javascript function (loginIntoApp) that accepts username and password as parameters to the method. This method sets the username and password to the hidden field and then post the form to a given action. The login page embeds an <IFrame> called "ChildFrame.html". This frame has an html form that accepts "username" and "password" from the user. On the submit of this form, a javascript is called which in turn calls the  javascript of its parent (loginIntoApp), mentioned above. I tried different things to write a test cases that login into the app, but i could not login. It works fine if i login using the web browser. Any suggestions or solution would be appreciated? Thanks. Al. 
> 
> When was the last time you saw your friends or family? Free unlimited Video Calls from Windows Live Messenger - download it here for FREE! Click here! -------------------------------------------------------------------------This SF.net email is sponsored by: MicrosoftDefy all challenges. Microsoft(R) Visual Studio 2008.http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________Httpunit-develop mailing [email protected]://lists.sourceforge.net/lists/listinfo/httpunit-develop
> _________________________________________________________________
> Download the new 2008 version of Windows Live Messenger here, FREE!
> http://get.live.com/messenger/overview

BITPlan - smart solutions
Pater-Delp-Str. 1, D-47877 Willich-Schiefbahn
Tel. +49 1805 - BITPLAN / +49 1805 248 752, Fax +49 2154 
811-481
Web: http://www.bitplan.de
bitplan GmbH, Willich - HRB 6820 Krefeld, VAT-ID: 
10258040584, Geschäftsführer: Wolfgang Fahl
Mit BITPlan effizient zum Erfolg: http://www.bitplan.de


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.