0

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

1 Answer 1

2

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");
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.