如果不是条件'否则'用select方法不起作用

时间:2017-09-02 15:01:46

标签: loops

我需要帮助: 这是一个下拉列表,我的要求是:如果选择了A然后选择B如果选择了B然后选择C如果选择了C然后选择A.下面是我的代码但它不起作用!!!

string=driver.findElement(By.id("JOBId"));
string=(VisibleText==("Mark JOB"));
//WebElement tmp = Select.getFirstSelectedOption();
//VisibleText = tmp.getText();


if (VisibleText==("Mark JOB")) {
    new Select(driver.findElement(By.id("GOBId"))).selectByVisibleText(" Larry JOB 
}       
    else if (VisibleText == "  Larry JOB "){
    new Select(driver.findElement(By.id("JOBId"))).selectByVisibleText(" Kevin JOB");   
}   
else if (VisibleText == " Kevin JOB ")
{
    new Select(driver.findElement(By.id("JOBId "))).selectByVisibleText(" Mark JOB");
}
else {
    System.out.println("Different initial JOB selected than expected");
}

0 个答案:

没有答案