K
K
koltykov2018-07-24 21:12:52
Parsing
koltykov, 2018-07-24 21:12:52

Raises the querySelector event in CasperJS?

There are 2 forms of Option Select.
When you select an element in the first form, the data is loaded into the second form (depending on what is selected in the first).
I'm trying to process this with CasperJS and it doesn't work for me.
Part of my code:

casper.waitForSelector('form#pcb-order-delivery-form', function() {
    this.evaluate(function() {
    	document.querySelector('select[name="country"]').value = 69;
    });

    this.wait(3000, function(){
    	this.capture('Test1.png');
    });
});


casper.waitForSelectorTextChange('select[name="delivery"] > option', function() {
    this.echo('The text on .delivery has been changed.');  
    this.echo(this.fetchText('select[name="delivery"] > option'));
    this.capture('Test5.png');
});

In the screen that Casper gives, I see that the selection in the select has been made, but data is not loaded into the second select.
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question