【问题标题】:Testing of pre -filled text in a text box测试文本框中的预填充文本
【发布时间】:2015-09-29 22:38:09
【问题描述】:

我有一个文本框,一些数据被预先填写在该文本框中。如何验证该文本框中的文本。

HTML 代码:-

<div id="blkinner_first_name_readonly" class="bhTextFieldWrapper">
<label class="blk_lbl" for="id_first_name_readonly">Your First Name</label>
<input id="id_first_name_readonly" class="bhTextField" type="text" disabled="disabled" value="" name="first_name_readonly">
</div>
</div>

【问题讨论】:

    标签: selenium-webdriver automation webdriver automated-tests ui-automation


    【解决方案1】:

    由于您没有提到您使用的绑定,我假设它是 Java。如果是这样,下面应该做的工作

    WebElement element = driver.findElement(By.id("id_first_name_readonly"));
    
    //Find the attribute value which stores the value of auto field name
    
    String name = element.getAttribute("value");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多