Saturday, 29 April 2017

CasperJS moving jQuery UI draggable item

I am trying to crawl some data from the web page and I need to move draggable item to droppable place. This is what I've tried so far:

var casper = require('casper').create();
var mouse = require('mouse').create(casper);

casper.start("https://uygulama.gtb.gov.tr/BeyannameSorgulama/",function() {
    this.sendKeys('input[id="txtBeyannameNo"]', '17341200EX119337');
    this.mouse.down('li.ui-draggable');
    this.mouse.move('#ajax-fc-circle');
    this.mouse.up('#ajax-fc-circle');
});

casper.then(function(){
    casper.capture('screenshots/test.png');
    this.click('input[id="btnSorgula"]');
});

casper.waitForSelector('span[id="LabelDurum"]', function (){
    casper.capture('screenshots/test2.png');
    console.log("OK!");
});

casper.run();

But I cannot manage to finish the process successfully.

What am I doing wrong?



via Barış Çağan Kurtuluş

No comments:

Post a Comment