1. How to get the entered text from the textbox.?
Ans: driver.findElement(By.name(“q”)).getAttribute(“Value)
2. How to get link text.?
Ans: driver.findElement(By.ClassName(bt_p)).getText(0;
3. How to get all values in dropdown.?
Ans: to get all items from the dropdown
Select drpitems = new Select( driver.findElement(By.name(“country”)));
List<WebElement> items = drpitems.getOptions();
Int size = items.size();
System.out.println(“Total number of items ” =size);
For (int i=0; i<size;i++)
Int j =i+1;
System.out.println(“Item “+j+” Dropdown value is ”+items.get(i) .getText());
4.How to get Radio Group & Select one option?
Ans:
List<WebElement> radios = driver.findElements(By.name(“ServClass”));
System.out.println(“Display the radio size”+ radios.size());
Radios.get(2).click();