Answer the question
In order to leave comments, you need to log in
Why is the button not being pressed?
I'm trying to login to a site written using angularjs using casperjs.
Connected cookies and client scripts
Screenshot of the page works. However, when you try to click on the login button, the screenshot does not display the Popup window with input elements for login and password.
So I'm thinking, is there an error when passing a click event or when taking a screenshot?
https://github.com/boskiv/iq-bot
The button I'm trying to click on is button[ng-click="login()"]
I've been reading the documentation for 3 days now, if someone tells me where to dig, I will thank you, but my eyes are already blurry.
PS try to add an event handler now, I'll see what's there.
Answer the question
In order to leave comments, you need to log in
Added an error handler on the client side. Now it has become a little clearer, but help is still needed :) Apparently, some scripts are missing:
[email protected]:~/iq$ casperjs casper.coffee
[info] [phantom] Using testhost: http://iqoption.com
[info] [phantom] Starting...
[info] [phantom] Running suite: 7 steps
[debug] [phantom] Automatically injected includes/jquery.min.js client side
[debug] [phantom] Automatically injected includes/app.js client side
[debug] [phantom] Automatically injected includes/jquery.cookie.js client side
[debug] [phantom] Successfully injected Casper client-side utilities
[debug] [phantom] start page is loaded
[info] [phantom] Step _step 3/7 https://iqoption.com/ (HTTP 200)
[info] [phantom] Step _step 3/7: done in 1487ms.
remote message caught: TypeError: 'undefined' is not a function (evaluating '$.url()')
at https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:1
at https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:1
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:10935
...
remote message caught: TypeError: 'undefined' is not a function (evaluating 'e.als({circular:"yes"})')
at https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:2
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:10887
...
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:12119
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:12766 <div class="als-container ng-isolate-scope" id="my-als-list">
[info] [phantom] waitFor() finished in 671ms.
[info] [phantom] Step anonymous 4/7 https://iqoption.com/us (HTTP 200)
remote message caught: Clicking to button
remote message caught: TypeError: 'undefined' is not a function (evaluating 'e.parent.scope()')
at e (https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:1)
at https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:1
at https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:1
at https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:1
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:10994
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:11952
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:10933
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:10933
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:11952
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:4676
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:4360
[info] [phantom] Step anonymous 4/7: done in 2726ms.
[info] [phantom] Step _step 5/7 https://iqoption.com/us (HTTP 200)
[info] [phantom] Step _step 5/7: done in 2750ms.
[warning] [phantom] Casper.waitFor() timeout
[debug] [phantom] Capturing page to /home/skivan/iq/timeout.png
[info] [phantom] Capture saved to /home/skivan/iq/timeout.png
[info] [phantom] Step anonymous 6/7 https://iqoption.com/us (HTTP 200)
[debug] [phantom] Mouse event 'mousedown' on selector: button[ng-click="login()"]
[debug] [phantom] Mouse event 'mouseup' on selector: button[ng-click="login()"]
[debug] [phantom] Mouse event 'click' on selector: button[ng-click="login()"]
remote message caught: TypeError: 'undefined' is not a function (evaluating 'e.parent.scope()')
at e (https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:1)
at https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:1
at https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:1
at https://static.iqoption.com//javascript/app.js?v=629f634f932553b6f8e6f7a06b0f0176:1
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:10994
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:11952
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:10933
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:10933
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:11952
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:4676
at https://static.iqoption.com//javascript/vendor.js?v=e598584bfb63a0373939a0d3ced116be:4360
[info] [phantom] Step anonymous 6/7: done in 8637ms.
[info] [phantom] Step anonymous 7/7 https://iqoption.com/us (HTTP 200)
[debug] [phantom] Capturing page to /home/skivan/iq/page.png
[info] [phantom] Capture saved to /home/skivan/iq/page.png
[info] [phantom] Step anonymous 7/7: done in 9436ms.
[info] [phantom] Done 7 steps in 9437ms
Doing $rootScope.login is extremely wrong behavior. I don’t know what and how you have it, but this code should be in the controller. In extreme cases - in the service.
The error seems to be due to the fact that some directive created an isolated scope and it does not have a login function.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question