Question

I'm trying to get casperjs to access a filesharing site, put urls into a form, submit the form, monitor the remote-upload progress, and finally return the generated links. The site Im working with is 180upload.com , with the Remote URL Upload button. In the ideal situation with the browser, I post the files I want this site to download and generate links for, and it will return me the link for the file.

This is what is supposed to happen: http://imgur.com/a/A9i9d

However, my code can never get past the "Initializing Upload" page. I can get everything to run, but it never gets past this page and never gets to show the upload progress bar and finish the file transfer. My code: http://pastebin.com/eqdZJkKX

When I run it, this is the 3 image screenshots it shows me: imgur.com /a/T1I8S

Everytime I run it, it will never finish executing, and every snapshot it creates just shows it at the "Initializing Upload" stage. How can I get this to work properly like in the 2 screenshots? I noticed right after it finishes the upload the page refreshes, but I'm not sure how to capture this and make casperjs account for it.

Était-ce utile?

La solution

Most likely you're not allowing the browser enough time to make the Ajax calls. You need to make sure any attempt to click or update etc.. that you pause after that to allow execution. I created a tutorial video which shows how I deal with Ajax sites by pausing after execution.

http://www.youtube.com/watch?v=Kefil5tCL9o

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top