0

I have this jQuery selector as below.

jQuery("html body div input[name='customer_name']").val();

According to that I have created the selector for selenium as below.

By cusNameTxtField = By.cssSelector("html body div input[name='customer_name']");

First expression giving me the expected output in the browser console, but using the second expression it returns null value. Is there any issue with the second expression ? And I am getting the String values as below in the java code.

String fieldText = waitForExpectedElement(cusNameTxtField, 10).getText();

1 Answer 1

1

Given this is an input element you might want to try

waitForExpectedElement(cusNameTxtField, 10).getAttribute("value");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.