The checkboxes are not getting checked when they are within the if...else if statements. But its working perfectly without if..else if. The code is skipping the if blocks. I couldn't find the reason of skipping. Below is the code snippet-
String manual = sht1.getRow(i).getCell(5).getStringCellValue();
String automation = sht1.getRow(i).getCell(6).getStringCellValue();
if (manual == "Y" && automation == "N"){
WebElement prof_manual = driver.findElement(By.xpath("/html/body/div[4]/div[1]/div/div[2]/div[1]/div/div[6]/div/form/table/tbody/tr[6]/td[2]/span[1]/input"));
prof_manual.click();
}
else if (manual == "N" && automation == "Y"){
WebElement prof_auto = driver.findElement(By.xpath("/html/body/div[4]/div[1]/div/div[2]/div[1]/div/div[6]/div/form/table/tbody/tr[6]/td[2]/span[2]/input"));
prof_auto.click();
}
else if (manual == "Y" && automation == "Y"){
WebElement prof_manual = driver.findElement(By.xpath("/html/body/div[4]/div[1]/div/div[2]/div[1]/div/div[6]/div/form/table/tbody/tr[6]/td[2]/span[1]/input"));
prof_manual.click();
WebElement prof_auto = driver.findElement(By.xpath("/html/body/div[4]/div[1]/div/div[2]/div[1]/div/div[6]/div/form/table/tbody/tr[6]/td[2]/span[2]/input"));
prof_auto.click();
}
String manual
andString automation
?