简体   繁体   English

如何使用webdriver验证从文本字段中提取自动填充值?

[英]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.

相关问题 文本字段使用javascript从数据库自动填充 - text field autopopulate from database using javascript 使用日期值自动填充文本字段 - Autopopulate Text Field with a Date Value 根据下拉值自动填充文本字段 - Autopopulate text field based on dropdown value Javascript-如何对文本文件中的特殊字符进行编码以自动填充文本字段 - Javascript - how to encode special characters from text file for autopopulate text field 使用Javascript自动填充PDF字段,其中110%是另一个字段的值 - Using Javascript to autopopulate a PDF field with 110% the value of another field 如何删除文本字段中的默认值,并使用Selenium WebDriver键入新值 - How to delete the default value in a text field and type a new value using Selenium WebDriver 如何使用JavaScript验证文本字段 - How to validate text field using javascript 如何<nobr>使用 selenium webdriver</nobr>提取里面的动态文本<nobr>?</nobr> - How to extract the dynamic text inside <nobr> using selenium webdriver? 验证只有5个值的文本字段 - validate a text field with only 5 value 如何使用 Java 在 Selenium WebDriver 的隐藏字段中输入一些文本 - How to type some text in hidden field in Selenium WebDriver using Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM