|
小弟在使用webdriver的过程中遇到一个问题。在页面上点击“登录”按钮后,弹出一个iframe窗口,用户输入后可登录,但是该iframe既没有ID也没有name,所以想用cssSelector来定位。现在想定位到输入邮箱的输入框里,但是一直报Unable to locate element,估计cssSelector写的问题求帮助,代码如下。谢谢。
- <div class="blockUI blockMsg blockPage" style="z-index: 20001; position: fixed; padding: 0px; margin: -160px 0px 0px -246px; top: 50%; left: 50%; text-align: left; color: rgb(0, 0, 0); cursor: pointer; width: 493px; height: 320px;">
- <div style="width:493px; height:320px;">
- <div id="close" style="position: absolute; right:16px; height:16px; width:16px; top:19px;"></div>
- <iframe width="493px" scrolling="no" height="320px" frameborder="0" src="http://passport.xxx.com/get_pop?hash=&referer=http://bj.xxx.com/">
- <!DOCTYPE html>
- <html>
- <head>
- <body>
- <div class="login_box">
- <div class="login_box_con_back"></div>
- <div class="login_box_con">
- <div class="login_box_bottom">
- <div class="login_top">
- <a class="close" title="关闭"></a>
- <img src="/static/images/login_title.png">
- </div>
- <form autocomplete="off" action="/login2" method="post">
- <div class="login_txt">
- <div class="login_left">
- <div class="w_log_1">
- <div class="loginFormIpt-1 item-input">
- <input id="email" class="loginFormTdIpt" type="text" title="请输入邮箱" name="email" maxlength="50" value="">
- <label class="placeholder" style="" for="email">邮箱/手机号</label>
- <label class="txt_no" style="display:none" for="email">用户不存在,或者被删除</label>
- <label class="txt_no" style="display:none" for="email">对不起,此用户被屏蔽</label>
- </div>
- <div class="loginFormIpt-2 item-input">
- <input id="password" class="loginFormTdIpt" type="password" autocomplete="off" title="请输入密码" name="password">
- <label class="placeholder" style="" for="password">密码</label>
- <label class="txt_no" style="display:none" for="password">您输入的密码不正确</label>
- </div>
- </div>
- <div class="loginFormCheck">
- <div class="loginFormIpt">
- <button id="loginBtn" class="btn btn-login" tabindex="6" type="submit">登 录</button>
- <a href="/locate_password" target="_blank" title="找回密码">忘记密码?</a>
- </div>
- <div class="x-ts">
- <div class="l-tips" style="display:none">
- </div>
- </div>
- <div class="login_right">
- <h2>注册</h2>
- <div class="loginFormVer">
- <div class="login-ico-arr">
复制代码 |
|