How to type in textbox using Selenium WebDriver

130 views
0

i want to type value in text field please let me know the code that in java Selenium Webdriver.

Answered question
0

you want to click on button and hyperlink below code is for you. i have created a funtion that will check before click that you button or link is clickable and displayed after it will click on button or hyperlink.

// Click on WebElement like button or hyperlink .
public static void Click(WebDriver driver, By by) {
try {
WebDriverWait wait1 = new WebDriverWait(driver, 28);
wait1.until(ExpectedConditions.elementToBeClickable(by));
// if (driver.findElement(by).isDisplayed())
WebElement Var = GetElement(driver, by);
if (Var != null)
if (Var.isDisplayed())
driver.findElement(by).click();
else
Log.error("Error in Clicking");
else
Log.error("Element Not Found...");
} catch (Exception e) {
e.getStackTrace();
}
}
Answered question