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)?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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