Get help with testing, discuss unit testing strategies etc.


Post by jrw »

IE 11 results in "Waiting for element" error. Chrome, Opera, and Firefox work ok.

Using the Siesta recorder in IE 11, I record a sequence as below:
describe("New recording...", function(t) {
    t.chain(
        { click : ".icon-plus", offset : [7.579998016357422, 7.279999732971191] },
        { click : "#AddEditWinID #PlannedDisposalDate => .x-form-trigger", offset : [16.260009765625, 18.420013427734375] },
        { click : "#AddEditWinID #PlannedDisposalDate datepicker => .x-datepicker-today .x-datepicker-date", offset : [24.41998291015625, 19.41998291015625] }
    );
});
I'm then able to step through this in recording in IE 11 and it works.

But when I create the following script (removing the offsets) and run it from the Siesta harness I get timeout error:
describe("DatePicker", function(t) {
    t.chain(
        { click : ".icon-plus" },
        { click : "#AddEditWinID #PlannedDisposalDate => .x-form-trigger" },
        { click : "#AddEditWinID #PlannedDisposalDate datepicker => .x-datepicker-today .x-datepicker-date" }
    );
});
Running this script, I get a message almost immediately:
Waiting for element "#AddEditWinID #PlannedDisposalDate datepicker => .x-datepicker-today .x-datepicker-date" to appear

It then times out and changes to
Waited too long for: element "#AddEditWinID #PlannedDisposalDate datepicker => .x-datepicker-today .x-datepicker-date" to appear
Failed assertion `waitForElementVisible`
Condition was not fullfilled during 10000ms

I’ve experimented with putting a delay of 1000 ms after the .x-form-trigger command, but it doesn’t help.
It shouldn’t take 10 seconds for the date picker to come up, though there is some timing dependency going on as it can sometimes work. Watching, it seems like it is giving up on the element being visible, then moving into the waitForElementVisible loop with the sure outcome being not visible. Some datepicker widgets it works on, on others it doesn't.

Any ideas on what I should be doing different? I’m completely new to this tool and ext.js and am probably missing something obvious.

Post by mats »

Hard to say what's going on. Could you zip up a complete isolated test case that we can run here to see what is going on?

Post by nickolay »

Siesta waits for the target element to be 1) visible in terms of "display: none", "visibility: hidden" 2) being a top element at its center point (or at the offset point given). The latter means, that point of the element should not be hidden by some other element (which is not a child of the target).

If any of the conditions fail, Siesta will wait. Check that datepickers don't use mask or anything..

Post Reply