Tuesday, August 2, 2016

How to select value from drop down box

You  can select through 3 method:
1. SelectByVisibleText
2. selectByIndex
3. selectByValue

First identifie the drop down box
Select dropdown = new Select(driver.findElement(By.id("<>")));

To select its option say 'Programmer' you can do
dropdown.selectByVisibleText("Programmer ");

or
dropdown.selectByIndex(1);

or
 dropdown.selectByValue("prog");

Monday, August 1, 2016


How to perform drag & Drop

First locate the source and destination e.g
webElement gsource = driver.findelement(by.id(“<>”));
webElement gdestination = driver.findelement(by.id(“<>”));

Actions ac = new Actions(driver);

ac.dragAndDrop(gsource, gdestination).perform();