mercredi 31 août 2016

Tellurium 52 - how to handle dynamically injected form element?

When I have to reference an element that exists in a DOM document I simply write

When "039f60d5-1b38-451a-b191-5e4b86273324" is selected from the "work_right_country_id" drop-down menu

and that works perfectly.

My problem is different. I have a dropdown that populates another dropdown with options that depend on a selected parent. Let's say that I have a static select / option with list of all countries. Person selects a country and that populates another dropdown with all available visas for that country. Dropdown with visas is populated via append in jQuery.

I thought that simply calling a "delay" command to Tellurium test will do the job - I will pick a country, wait 2 seconds for a population of visas by calling:

Given a test delay of 2 seconds

then:

When "4e15548c-5327-4a7e-95a2-3923d7355e2c" is selected from the "work_right_id" drop-down menu

Apparently it fails:

enter image description here

Any ideas how to call elements that are not part of a static DOM?

Aucun commentaire:

Enregistrer un commentaire