我正在尝试在selenium webdriver中导入数据驱动的框架。
string passValue;
passValue = xlData[row][col];
for (int row = 1; row < xlData.length; row++) {
for(int col = 0; col < xlData[0].length; col++) {
wt.until(ExpectedConditions.elementsTobeclickable(By.cssSelectors("option[value=passValue]"))).click();
//How To pass value in above line of code?
}
}
//same question for the xpath as well
答案 0 :(得分:4)
这就是你的意思:
获取变量并将其插入到css中?还是xpath?等
wt.until(ExpectedConditions.elementsTobeclickable(By.cssSelectors("option[value=" + passValue + "]"))).click();