【发布时间】:2017-01-17 07:36:23
【问题描述】:
所有属性形式相同但脚本到达最后一个元素显示“元素不可见错误”
同一级别 div 标签中的所有元素,但脚本运行单击事件(注册按钮)显示错误消息“元素不可见”。但是,除了提交按钮单击之外,我可以在其中填充数据并能够运行单击事件的所有其他字段也可以在弹出窗口中使用。问题我有弹出我添加截图图像。
此处为 HTML 代码 –
<form id="sighUpForm" class="form-signin ng-pristine ng-invalid ng-invalid-required ng-valid-pattern" novalidate="" name="sighUpForm">
<div class="row">
<div class="form-group">
<div class="form-group">
<div class="row">
<div class="form-group">
<label class="ng-bind-htmling" ng-bind-html="translation.signup_mobile">Mobile No.</label>
<div class="input-group">
<span class="error-msg ng-hide" style="color:red" ng-show="sighUpForm.PhoneNo.$invalid && submitted">
</div>
<div style="text-align:center;">
<label class="checkbox-inline ng-bind-htmling" style="line-height:1.8; font-size:12px">
<input class="ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required" type="checkbox" value="" ng-model="user.termAndCondition" required="" name="termAndcondition" style="height:15px; width:15px; margin-top:5px; margin-right:3px "/>
I agree to the
<a data-target="#tandcmodal" data-toggle="modal" href="#">
and
<a data-target="#ppmodal" data-toggle="modal" href="#">
</label>
<br/>
</div>
<div class="text-center">
<!-- <small class="tc-text">By signing up, you agree to our <a href="#" data-toggle="modal" data-target="#tandcmodal">Terms & Condions</a> and <a href="#" data-toggle="modal" data-target="#ppmodal">Privacy Policy</a></small><br />-->
<!--<button id="submitSignup" type="submit" ng-click="SignUpUser()" class="button signup-btn">Signup</button>-->
<a id="submitSignup" class="button signup-btn" ng-click="SignUpUser()">
</div>
</form>
这里的硒代码:-
//Enter PhoneNumber
driver.findElement(By.xpath(prop.getProperty("SignUpPhoneNo"))).sendKeys(prop.getProperty("PhoneNumber"));
Thread.sleep(500);
//Click Agree Tick
driver.findElement(By.xpath(".//*[@id='sighUpForm']/div[6]/label/input")).click();
Thread.sleep(600);
//Click Submit button
driver.findElement(By.xpath(".//*[@id='submitSignup']/span")).click();
弹出图片:-
【问题讨论】:
-
你想点击弹出的注册按钮吗??
标签: javascript jquery html css selenium