元素应禁用

时间:2018-12-31 00:59:55

标签: selenium robotframework keyword

我想检查元素是否不可编辑,并且是只读的。为了这 我使用Element Should Be Disabled关键字,但是在运行测试用例时遇到了麻烦。

当我运行此测试用例时:

SeleniumLibrary.Element Should Be Disabled    id=typeC
SeleniumLibrary.Element Should Be Disabled    id=TypeI

对于此HTML代码:

<div _ngcontent-c10="">
  <label _ngcontent-c10="" class="radio-inline">
     <label _ngcontent-c10="" class="input-field">
        <input _ngcontent-c10="" formcontrolname="type" id="typeC" name="type" type="radio" value="C" class="ng-pristine ng-touched" disabled="">
            Company
      </label>
   </label>
  <label _ngcontent-c10="" class="radio-inline">
      <label _ngcontent-c10="" class="input-field">
        <input _ngcontent-c10="" formcontrolname="type" id="TypeI" name="type" type="radio" value="I" class="ng-pristine ng-touched" disabled="">
            Individual
      </label>
   </label>
 </div>

我遇到此错误:

Element 'id=typeC' is enabled.

当我尝试:

SeleniumLibrary.Element Should Be Enabled    id=typeC
SeleniumLibrary.Element Should Be Enabled    id=TypeI

错误是:

Element 'id=typeC' is disabled.

0 个答案:

没有答案