【问题标题】:Getting Text from Modal : Protractor / Webdriver从模态获取文本:量角器/Webdriver
【发布时间】:2014-07-28 17:21:10
【问题描述】:
<input type="text" class="form-control input-lg" id="name" placeholder="Insert Your Name Here" ng-model="form.Name" required>

我有一个如上所述的模型。我正在尝试在输入文本后对其进行验证。我见过其他类似的例子,但没有什么对我有用。我正在尝试使用此设置对其进行测试。我最终得到了

Expected null to equal 'Your Inputted Text'

在页面对象文件中。

this.formInput = element(by.model('form.Name'));    

在测试文件中。

setup.formInput.sendKeys('Jim');
setup.formName.click().then(function () {
        expect(setup.formInput.getAttribute('form.Name')).toEqual('Jim');
    });

如何捕获/确认输入的文本?

【问题讨论】:

    标签: angularjs selenium-webdriver protractor


    【解决方案1】:
    setup.formInput.getAttribute('value')
    

    未测试。但我希望这会返回你想要的文本

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-23
      • 2015-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-01
      相关资源
      最近更新 更多