My site has a text field with a default value that is filled after first user login. But, on the first visit, the text box is empty. How can I check if a text box is empty or not? Using Katalon Studio keywords (or Selenium, because I figure it should be the same or similar)?
1 Answer
Try this, get the value inside the input box and compare.
WebElement A = driver.findElementById("locator");
String text = A.getAttribute("value");
if(text.isEmpty()){
System.Out.Println("input box is empty");
}