How to click on the Round Trip radio button within SpiceJet website. It gets selected but after few seconds oneway is selected as default
Below is the code to automate spicejet website as on 11Novemeber 2020. Even if i click on Roundtrip radio button, by default oneway radio button gets selected. How do i resolve this issue?
package practice;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.WebDriverWait;
public class Spicejet {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\User\\Desktop\\selenium\\chromedriver_win32 (1)\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.spicejet.com/");
driver.manage().window().maximize();
driver.findElement(By.xpath("//input[@value='RoundTrip']")).click();
new WebDriverWait(driver, 20).until(ExpectedConditions
.visibilityOfElementLocated(By.xpath("//input[@id='ctl00_mainContent_ddl_originStation1_CTXT']")))
.click();
driver.findElement(By.xpath(
"//div[@id='glsctl00_mainContent_ddl_originStation1_CTNR']//table[@id='citydropdown']//li/a[@value='MAA']"))
.click();
driver.findElement(By.xpath(
"//div[@id='ctl00_mainContent_ddl_destinationStation1_CTNR']//table[@id='citydropdown']//li/a[@value='BLR']"))
.click();
driver.close();
}
}