Closed SeriousM closed 11 years ago
At the moment, when you click on a link, the resulting casperjs test does assert the element exists and then clicks on it. So what you propose is to also assert that the href is the one expected, correct ?
Yes and if I have seen it correctly the script contains a click with coordinates which should not be the case. It is not good because the script depends on the recording browser's resolution/size.
var x = require('casper').selectXPath;
var casper = require('casper').create();
casper.options.viewportSize = {width: 1920, height: 1137};
casper.start('http://wetter.orf.at/oes/');
casper.then(function() {
this.mouse.click(725, 187);
});
casper.run(function() {this.test.renderResults(true);});
Yes indeed, mouse click is not always properly handled right now. The idea here is to be able to produce special click sequences (like drag&drop for instance), so Resurrectio records x and y for all mouse down and mouse up events. When generating the CasperJS script, depending on the object we clicked, it should produce either a click event on the element, either a (x, y) click. In your case, it comes form this line: https://github.com/ebrehault/resurrectio/blob/master/casper.js#L268 your clicked element is probably not a a, an input or a button.
My element was a div wrapped in a a-tag.
I understand and like the way how you deal with links because not everything is a link, it is maybe just a bound js-function. The disadvantage is that an element on a pages with dynamic content can be "anywhere", take the Comment
button on this github page.
Can't you just locate the element and then click on it? Or add a context menu to choose the right action, not the default one.
Cheers :)
Now there is an option to generate the Casperjs script using (x,y) moure event events specifically.
With regular mode, for now, for all elments but a
, input
or button
, it only work if the lement has an id.
see https://github.com/ebrehault/resurrectio/issues/5 which aims to improve this behaviour
I still have a problem with that but it is more a bug.
I have this workflow: http://i.imgur.com/ThnfuLr.jpg.
when i export it as "Export CasperJS" this is the result: https://gist.github.com/SeriousM/5747073#file-casperjs
(focus on the massive undefined
)
with x,y everithing looks legit: https://gist.github.com/SeriousM/5747073#file-casperjs-x-y
Cheers
well I am not sure I made exactly the same workflow, but here is what I get: https://gist.github.com/ebrehault/5747228
hmmm, i thought pulling latest version and click "update extensions" were enough. nope :) reinstalled the extension -> works fine!
Actually, the easiest way is:
It should be enough.
I totally not saw this button, thx :)
Hi,
can we get a function that says something like
rmb on link use link
so that the elements existence is checked, the href must match and then a mouse-click of the element?
Cheers