[英]How to validate Extract Autopopulate value from text field using webdriver?
I have Zipcode input box , once I entered Zipcode , the state and city input boxes are auto populating with the relevant data. 我有Zipcode输入框,输入Zipcode后,州和城市输入框会自动填充相关数据。 how to capture and validate those State and city input box value enter image description heres using Selenium enter image description here Webdriver ?
如何捕获和验证那些州和城市输入框的值,使用Selenium 在此处输入图像说明 Webdriver?
Only thing here is you need to use getText() to retrieve text from any specified location and can verify by assertions. 这里唯一的事情是您需要使用getText()从任何指定位置检索文本并可以通过断言进行验证。 Lets say id of state field is 'state', then
假设状态字段的ID为“州”,则
String populatedState=driver.findElement(By.id("state")).getText();
Assert.assertEquals(populatedState, "expected state here");
Thank You, Murali 谢谢,穆拉利
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.