0

我想对输入文本进行测试:

<input _ngcontent-c21="" autocomplete="new-password" class="form-control modal-input ng-pristine ng-valid ng-touched" id="prenom" name="prenom" type="text" xpath="1">

我的代码是:

Click Element   xpath://span[contains(text(),'Nous contacter')]
Sleep   2
Location Should Be      ${contactPageUrl}
Click Element   xpath://input[@id='prenom']
Sleep   2
Element Text Should Be      xpath://input[@id='prenom']     ${USERFIRSTNAME}

但是我得到的结果是输入文本是空的,即使不是,是因为autocomplete="new-password"?

4

1 回答 1

0

这是 的一个input字段type="text",但您没有在其中输入任何文本。如果您希望该字段自动填充${USERFIRSTNAME},则缺少触发 Angular 动作。这可能是时间问题,您没有等待该字段自动填充,或者您需要单击元素来触发它。

于 2020-05-25T12:57:28.963 回答