- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一个门户网站,我们可以在其中从三个单选按钮中选择凭证类型。它不起作用:我收到错误。
import java.util.concurrent.TimeUnit;
import org.apache.log4j.Logger;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Vouchertest {
public static void main(String[] args) {
WebDriver driver=new FirefoxDriver();
Logger log = Logger.getLogger("devpinoyLogger");
driver.get("url");
log.debug("entring username");
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.findElement(By.xpath("//*[@id='UserName']")).sendKeys("xoxo");
log.debug("entering password");
driver.findElement(By.xpath("//*[@id='Password']")).sendKeys("Password123");
log.debug("Clicking login");
driver.findElement(By.xpath("//*[@id='loginForm']/form/div[4]/div/input")).click();
log.debug("Clicking voucher");
driver.findElement(By.xpath("html/body/nav/div[2]/div[2]/ul/li[2]/a")).click();
log.debug("Clicking create_voucher");
driver.findElement(By.xpath("//*[@id='main']/a[1]")).click();
**log.debug("Clicking voucher_type");
driver.findElement(By.cssSelector("input[value='card']")).click();
}
}
这里是 html 代码:
<input id="VoucherType" type="radio" value="Corporate" name="VoucherType">
<label for="Corporate_Certificate">Corporate Certificate</label>
<input id="VoucherType" type="radio" value="Card" name="VoucherType">
<label for="Gift_Card">Gift Card</label>
<input id="VoucherType" type="radio" value="Adv" name="VoucherType">
<label for="Advanced_Payment">Advanced Payment</label>
这是跟踪:
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"css selector","selector":"input[value='card']"}
Command duration or timeout: 30.12 seconds
最佳答案
在 HTML 代码中,“Card”以大写字母开头,而在 Java 代码中,它的写法如下:“input[value='card']”
关于java - BAD : need suggest on selenium using radio button select. 有三个单选按钮。需要选择适当的。但出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33799115/
我对软件 radio 感兴趣。我基本上没有涉及任何电气工程或数学主题的经验,但我正在阅读...... 与其尝试处理天线和 ADC 的硬件方面,我想它会很有趣(而且更便宜)来播放一些预先录制的(甚至是实
我是 C++ 的新手,想了解一些东西。我的 main.cpp 中有这段代码: Radio r = Radio("PSR", 100.8); 或者那个代码: Radio r("PSR", 100.8);
我是 C++ 的新手,想了解一些东西。我的 main.cpp 中有这段代码: Radio r = Radio("PSR", 100.8); 或者那个代码: Radio r("PSR", 100.8);
如何将选定的 radio (从 radio 组)复制到另一个 radio ?这是我的jsfiddle:http://jsfiddle.net/fu3oyscq/1/ 这是我的jquery $("#co
我有这个表格: 1 X 2 1 2 我想实现这个: If a=1 then b=1 If a=X then unset b If a=2 then b=2 我尝试了这个,但没有任何作用: $
我为什么要为此苦苦挣扎? 我有一个值:5 如何查看值为 5 的组“mygroup”的单选按钮? $("input[name=mygroup]").val(5); // doesn't work? 最佳
正如标题所说例如: User1 User2 如何获取文本:用户 1 最佳答案 $('input:radio:checked').siblings('label:first').html() 更新:
无法在 Bootstrap radio 组中检查 radio 。只有 div 处于事件状态。 Link Bootstrap 单选组: Enabled Disa
如何禁用 radio 组中的一个 radio 输入? Option1 Option2 Option3 Option4 我的问题是我想在单击任何其他按钮后禁用选项1 例如: when i sele
我正在使用 jQuery 验证来验证其上设置了单选按钮的表单(在本例中设置 = 两个单选按钮)。带标签的单选按钮如下。该表单位于 jQueryUI 对话框上。 Yes No 我从 jquery.com
我有一个包含 26 个问题的表格,所有问题都有单选按钮组作为用户的答案选择(它计算给定属性(property)上特定入侵植物物种的风险因素)。最后,将每个 radio 组中的选定值相加。 让事情变得复
我创建了一个单选组列表并将它们附加到一个产品类别。因此,我正在做的是检查该类别应具有的组,然后选取该类别可用的这些组中的单选值并将其显示给用户进行填充。 接下来我想将它们传递给我的 ajax 函数,然
圆形边缘刚好从正方形或圆形中伸出,因此如果我在 before 之前提供白色背景,则 radio 边缘仍然略微可见。 input[type=radio] { box-sizing: border-b
我找到了一个纯 CSS 星级系统,但是对于给定的代码,我只能在每个页面上使用一个星级系统。我试过更改类(class)名称,但不幸的是,第二个星级评分表在按下时会检查第一个星级评分表。有什么办法解决这个
我有一个包含 radio 输入和标签的无序列表。当用户点击列表项时,它会切换一些信息并选择单选输入。 但是,由于上述原因,如果用户点击实际的 radio 输入本身,它不会选择它,因为我猜点击是针对 r
我想使用一些 radio 输入创建一个表单。检查输入时,还会使用 jQuery 自动检查另一个 radio 。 例如: 问题1:A(勾选),B,Cquestion2: D(auto checked),
如果我检查了名称为“most1”且值相同的单选按钮,如何禁用名称为“least1”的单选按钮 最佳答案 在
如何在选择第一个 radio 输入时选择所有复选框并在选择第二个 radio 输入时取消选中所有复选框? (Javascript)? 我在这里研究过以前的类似问题,但它们似乎都是关于使用复选框而不是单
Please, please check me Am I selected ? 我想要以下行为: 当 myCheckbox 被选中时,myRadio 将被选中。 当 myCheckbox
我知道无符号数永远不会小于 0,因此无需对其进行测试。但我想避免调谐器出现虚假频率。 /* freqKHz is in KHz (duh) */ void videoinput_set_tuner
我是一名优秀的程序员,十分优秀!