|
7#
楼主 |
发表于 2015-11-25 09:59:38
|
只看该作者
我试过用driver.manage().timeouts().implicitlyWait(120,TimeUnit.SECONDS);和sleep()都不行,你看下代码吧!
登陆页面html:
<body>
<div class="top">
<div class="top_box">
<div class="logo"></div>
<div class="logo_right"></div>
</div>
</div>
<div class="top_line"></div>
<div class="banner">
<div class="login_box">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<form action="call.login" name="loginform" method="post" id="signin-form"></form>
<tbody><tr>
<td class="title"> </td>
</tr>
<tr>
<td class="login_text">用户名:</td>
</tr>
<tr>
<td><input type="text" placeholder="请输入用户名" onkeydown="keydown()" id="inputuser" class="login_input" name="username"></td>
</tr>
<tr>
<td class="login_text">密码:</td>
</tr>
<tr>
<td><input type="password" placeholder="请输入密码" onkeydown="keydown()" class="login_input" name="password"></td>
</tr>
<tr>
<td><input type="button" value="登 录" class="login_button" name="loginbtn"></td>
</tr>
</tbody></table>
</div>
</div>
<div class="info">版权所有:XXX </div>
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="3rd/jquery.min.js"></script>
<script type="text/javascript" src="3rd/jquery.form.js"></script>
<script type="text/javascript">
function keydown(){
if(event.keyCode == 13){
event.returnValue=false;
event.cancel = true;
loginform.loginbtn.click();
}
}
$(function(){
$('#inputuser').focus();
$('.login_button').on('click',function(){
$("#signin-form").ajaxSubmit({
success:function(data){
data = JSON.parse(data);
if (data.success) {
window.location.href = "main.html";
} else {
alert(data.message);
$('#inputuser').focus();
$('#inputuser').select();
}
}
});
})
});
</script>
登陆成功跳转页面html:
<body style="margin:0px;height:100%;overflow:hidden;background:#fff">
<iframe frameborder="0" scrolling="no" style="height:100%;width:100%" src="mas/home/index.html"></iframe>
|
|