Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

submit() doesn't seem to work for an aspx page #7

Open
vinbrown2 opened this issue Aug 15, 2013 · 5 comments
Open

submit() doesn't seem to work for an aspx page #7

vinbrown2 opened this issue Aug 15, 2013 · 5 comments
Assignees
Labels

Comments

@vinbrown2
Copy link

Tech stack:
asp.net web forms
.NET Framework 4.0

Steps to reproduce:

  1. create an aspx form with a username and password field and a submit button
  2. create a test (here's my sample)
    module.exports = {
    'I can log in': function(test) {
    test
    .open('myLogin.aspx')
    .assert.url().is('myLogin.aspx', 'At the login page')
    .type('#oUserID', 'John', 'user name is')
    .assert.val('#oUserID', 'John', 'text has been set')
    .type('#oPwdID', 'pswdpswd1', 'password name is')
    .assert.val('#oPwdID', 'pswdpswd1', 'password has been set')
    .submit('#frmLogin')
    .done();
    }
    };
    image
  3. Test hangs/becomes unresponsive after the submit step.
@ghost ghost assigned asciidisco Aug 16, 2013
@asciidisco
Copy link
Member

From what i see, your test looks good.
Could you change your test in a way, that you don't use the submit function and instead make a "real" click
on your submit button? This would help me to track down the error a bit.

'I can log in': function(test) {
  test
    .open('myLogin.aspx')
    .assert.url().is('myLogin.aspx', 'At the login page')
    .type('#oUserID', 'John', 'user name is')
    .assert.val('#oUserID', 'John', 'text has been set')
    .type('#oPwdID', 'pswdpswd1', 'password name is')
    .assert.val('#oPwdID', 'pswdpswd1', 'password has been set')
    .click('#my-button')
    .done();
  }
};

Also, I don't have an .aspx compatible env here to reproduce everything.
If you could post the generated HTML (or at least a skeleton), that would be very helpful for me to check.

Thanks for testing dalek & reporting the issue.

@vinbrown2
Copy link
Author

I've tried the click() method but still no luck. Here's the markup of the login page (my humblest apologies for the ugly markup. It's webforms. It's by design). It seems this forum actually renders the html, but hopefully you can get the markup by viewing source. Let me know if you need anything else.

    <div class="wrapper_OneColumn interimWrap" id="loginSection" style="display: block;">
        <h2>Member Login</h2><table id="memberlogin" border="0" cellspacing="0" cellpadding="0" width="100%" class="columns" style="color:#4A4A4A;">
<tbody><tr>
    <td><div class="badLogin" style="display:none; float: left; padding: 2px 10px 5px 2px; width: 95%; color:#cc0000; border: solid 2pt #cc0000;"><div class="badLoginInner" style="margin:5px; margin-top: 0px; float: left;"><img src="/images/general/alert_icon_anim.gif" width="20" height="20" alt="Warning!" style="margin-right: 5px;"></div><div style="float:left; width: 90%"><span id="warningMsg">Your account is currently locked due to too many unsuccessful log in attempts. You will not be able to access your account until you </span><a id="oUpdatePswd" tabindex="4" onclick="window.open('/session/pwdassist.aspx','_blank','width=550px,height=350px,left='+((screen.width - 550) / 2)+',top='+ (screen.height - 350) / 2+'');return false;" href="/session/pwdassist.aspx" target="_blank">update your password</a></div><div style="clear:both;height:15px;"></div><div id="lastTryDiv" style="padding-left: 35px; display:none;"><a id="oBadLoginForgot" tabindex="4" onclick="window.open('/session/pwdassist.aspx','_blank','width=550px,height=350px,left='+((screen.width - 550) / 2)+',top='+ (screen.height - 350) / 2+'');return false;" href="/session/pwdassist.aspx" target="_blank">Create a new one</a></div></div><div style="clear:both;height:15px;"></div></td>
</tr>
<tr>
    <td class="loginEmail"><input name="_ctl0$MainContentPlaceHolder$oSession$oUserID" type="text" value="Member ID or Email Address" maxlength="100" id="oUserID" tabindex="1" title="Member ID or Email Address" class="watermark signin"></td>
</tr>
<tr>
    <td class="loginPassword"><input name="_ctl0$MainContentPlaceHolder$oSession$oPwdID" type="password" maxlength="50" id="oPwdID" title="Password" class="signin" autocomplete="off" style="display: none;"><input name="_ctl0$MainContentPlaceHolder$oSession$txtPlainPassword" type="text" value="Password" id="txtPlainPassword" tabindex="2" class="graytext"><input type="hidden" name="_ctl0$MainContentPlaceHolder$oSession$customerGUID" id="customerGUID"></td>
</tr>
<tr>
    <td class="forgotCell"><br><a id="oForgot" tabindex="4" onclick="window.open('/session/pwdassist.aspx','_blank','width=550px,height=350px,left='+((screen.width - 550) / 2)+',top='+ (screen.height - 350) / 2+'');return false;" href="/session/pwdget.aspx" target="_blank">Forgot your password?</a></td>
</tr>
<tr>
    <td class="rememberUser"><input id="chkPwd" type="checkbox" name="_ctl0$MainContentPlaceHolder$oSession$chkPwd" tabindex="3"><label class="remembermeLabel" for="oSession_chkPwd">Remember my Member ID or email address</label></td>
</tr>
<script language="javascript" type="text/javascript">document.forms[0].action="/Login.aspx"</script>

@vinbrown2
Copy link
Author

Ok, I've got a bit more info. It seems there are multiple issues here.

  1. setValue() doesn't seem to work at all in any browser
  2. type() doesn't seem to work if the field is styled display:none.

I have changed the login form to not hide the text field and it now works! I had to use the click() method to submit the form though. submit() still doesn't work. Not sure if you want to close this issue or not, but at least I have a workaround.

@asciidisco
Copy link
Member

Hey,
could you please update to dalek 0.0.2 & test this again, maybe with the -l 5 flag which will now output the raw webdriver communication. If there still is a problem, that will extremely help to track it down.

@vinbrown2
Copy link
Author

Sure. I'll try it again either today or tomorrow and let you know what
happens. I've got a tight deadline at the moment, so just have to finish up
with the task at hand first.

On Mon, Sep 23, 2013 at 12:52 PM, Sebastian Golasch <
notifications@github.com> wrote:

Hey,
could you please update to dalek 0.0.2 & test this again, maybe with the -l
5 flag which will now output the raw webdriver communication. If there
still is a problem, that will extremely help to track it down.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-24934841
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants