Dropdown Code
Dropdown Code
driver.findElement(By.id("divpaxinfo")).click();
Thread.sleep(2000L);
/*int i=1;
while(i<5)
driver.findElement(By.id("hrefIncAdt")).click();//4 times
i++;
}*/
System.out.println(driver.findElement(By.id("divpaxinfo")).getText());
for(int i=1;i<5;i++)
driver.findElement(By.id("hrefIncAdt")).click();
driver.findElement(By.id("btnclosepaxoption")).click();
System.out.println(driver.findElement(By.id("divpaxinfo")).getText(
****************************************
Code Snippet download
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
System.setProperty("webdriver.chrome.driver", "C://work//chromedriver.exe");
// //a[@value='BLR']
driver.findElement(By.id("ctl00_mainContent_ddl_originStation1_CTXT")).click();
driver.findElement(By.xpath("//a[@value='BLR']")).click();
Thread.sleep(2000);
//driver.findElement(By.xpath("(//a[@value='MAA'])[2]")).click();
driver.findElement(By.xpath("//
div[@id='glsctl00_mainContent_ddl_destinationStation1_CTNR']
//a[@value='MAA']")).click();
driver.findElement(By.cssSelector(".ui-state-default.ui-state-highlight.ui-state-
active")).click();