Selenium IDE找不到ID [英] Selenium IDE cannot find ID

查看:90
本文介绍了Selenium IDE找不到ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用Selenium IDE记录了一个测试,但是当我尝试运行该测试时,出现错误 [错误]找不到元素id = jsonform-0-elt-businessActor

I recorded a test with Selenium IDE but when I try to run the test I get an error [error] Element id=jsonform-0-elt-businessActor not found

我还注意到此特定字段的ID略有不同..其余字段的格式为 id = jsonform-0-elt-0.nameOfJsonAttribute

I also noticed this particular field's id is slightly different.. The rest of the fields have this format id=jsonform-0-elt-0.nameOfJsonAttribute

bussinessActor ID不能正常工作并以不同的方式捕获吗?

Could there be any reason why the bussinessActor ID is not working and captured differently?

用于渲染表单的JsonSchema:

{ 
    "type":"object",
    "id": "001",
    "title": "testSchema",
    "properties":{
      "businessActor": { 
        "type":"string",
        "title": "Name",
        "description": "example of a description."
      }
    }
}

注意:我正在使用 jsonForm 来呈现基于json shema的表单.表单ID由jsonFom动态生成.而且我也在使用Angular.js(我认为Angular在这个特殊问题中没有发挥作用)

Note: Am using jsonForm to render the form based on json shema. Form id's are generated dynamically by jsonFom. And am also using Angular.js (angular is not playing a role in this aprticular issue, I think)

推荐答案

如@MarkRowlands所建议,听起来您的页面是动态的.

As @MarkRowlands suggested, it sounds like your page is dynamic.

尝试一下作为您的 target ...

Try this out as your target...

css=[id^='jsonform'][id$='businessActor']

^ = 表示CSS中的开头为". $ = 表示CSS中的结尾为".

^= means 'starts with' in css. $= means 'ends with' in css.

更改该选择器以匹配您想要选择的任何内容.

Change that selector to match whatever you would like to select.

这篇关于Selenium IDE找不到ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆