1

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

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

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

JsonSchema used to render the form:

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

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)

Simo Mafuxwana
  • 3,702
  • 6
  • 41
  • 59
  • 1
    I would guess that the ID is dynamic. As such it will not be the same each time you open the website/execute the script/doSomething. As such, you'll need to change the selector to find via CSS or Xpath instead of via ID. As you're using the IDE, you'll need to change the target to something else. Unfortunately, without seeing the HTML you are trying to access I can't show you a suitable Xpath. – Mark Rowlands Sep 23 '13 at 13:55
  • Just a note, I looked at the ID.. On Firefox it looks like ID is dynamic. However on chrome it is always the same. – Simo Mafuxwana Sep 23 '13 at 14:16

1 Answers1

1

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

Try this out as your target...

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

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

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

ddavison
  • 28,221
  • 15
  • 85
  • 110