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();
鉴于这是一个input
元素,您可能想尝试
waitForExpectedElement(cusNameTxtField, 10).getAttribute("value");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.