Login Register

How dojox.robot.recorder captures mouse move actions?

Hi,

Im new to doh.robot. I have used dojox.robot.recorder to record the events in my testpage. But I found that,

1. If my element has an id, recorder captures the event using the id like doh.robot.mouseMoveAt('myElementsId',...)

2. But when my element does not have an id, then recorder uses document.getElementByTagName over an index to get my element. Ex: doh.robot.mouseMoveAt(function(){ return document.getElementsByTagName('SPAN')[122]; }, ...)

This is definitely gonna be fragile because my desired element's position in the document can be changed anytime and i will have to record the entire test scripts again whenever there is a change.

3. And sometimes(ex : when my element is a part of a widget), recorder takes absolute pixel positions to locate the element. For ex: doh.robot.mouseMove(199, 36, 1059, 437, true);

So I dont get the desired mouse position in a screen of different resolution.

Is there better solution to implement the same? Appreciate your help in this.

Hi, I got the above problem

Hi,

I got the above problem of fragile code resolved!! I just made a simple change in recorder.js to check if my elements parent has an id and passed the parent as selector node. Though this doesnt sound like the perfect solution, this is gonna work fine in our application. It would be gr8, if there is any fix scheduled in future releases.

But then I have got a question, will my recorder be able to capture events performed on an alert/confirmation box? I tried a simple example that records events performed on an alert box and it didnt work for me :( If recorder cannot capture this, this should be possible by getting the alertbox from the window object.

Suggestions are most welcome.