我有一个名为"inputIDD“的sitring,例如: String InputIDD= "input-2”;并希望将此字符串传递到其中:“input-2”的用法如下:
String InputIDD = "input-2";
for (int a = 1; a <= 6; a++)
{
System.out.println("Value of a:" + a);
System.out.println("Value of InputID:" + InputID);
// String y= Integer.toString(x);
switch (a) {
case 1:
driver.findElementByXPath("(//input[@id='input-2'])[1]").sendKeys("0");
break;
case 2:
driver.findElementByXPath("(//input[@id=InputIDD])[2]").sendKeys(ToAdd);
break; // optional
等,
driver.findElementByXPath("(//input[@id='input-2'])[1]").sendKeys("0");
:WORKS driver.findElementByXPath("(//input[@id=InputIDD])[1]").sendKeys("0");
:不工作
怎么了,有什么想法吗?
https://stackoverflow.com/questions/52264855
复制相似问题