Closed ericwooley closed 10 years ago
How are you invoking protractor on the command line? This is working fine for me with protractor debug spec/mochaConf.js
.
@ericwooley do you have any additional information on this? I've played with the debugger quite a bit the past week and never encountered this. Please let me know if you have more details to reproduce, or otherwise I'll close this issue soon.
Sorry for the late response, somehow I missed the email for the first reply.
After some experimentation, I suspected that it had to do with my browser synchronization being turned off, however,I had a bit of a deadline so I ended up reverting back to 0.22.
I will play with this later tonight and see if I can reproduce it in a vagrant box.
I recreated the issue in a vagrant box here: https://github.com/ericwooley/Vagrant-nodeDev-Protractor-Debug-Error
Can you try again angularjs.org? www.example.com is not a valid angular-based website and protractor won't work on it.
Also, to save you the trouble of debugging, try changing your findElements statement to:
element(by.xpath('/html/body/form/div[3]/div[2]/div')).
all(by.tagName('input')).
then(function(eles){
//eles.length; eles[4].click(); etc
});
I updated it to use angularjs.org, the problem still persists. However, I am not sure if it is browser synchronization anymore. I tested it on angularjs.org with and without sync and and still had the problem.
You'll make your life easier by adding an extra it()
just for the purposing of the break point, following your example, like this:
describe('clearing all the descounts', function(){
it('should clear all inputs in the discounts sections', function () {
browser.driver.get('http://angularjs.org');
});
it('helps me debug', function() {
browser.debugger();
});
it('continues your tests', function() {
element(by.xpath('/html/body/form/div[3]/div[2]/div')).all(by.tagName('input')....
});
});
Thanks for the advice @elgalu and occasionally I do that. However it's not exactly optimal in all cases. This example is pretty contrived, which is why I didn't do it that way. Technically, that may be a valid solution/workaround, but even in the documentation it says you can put a browser.debugger
line right above the line that is giving you the error.
I just tested to confirm that your workaround does work.
Also this problem persists into 0.24.2
Edit: I updated the selenium server and the problem went away. I am not sure what exactly what changed, but in any case it's working perfectly now.
I am using mocha
as of 0.23.1, this worked fine
However, with the latest release (0.24), the browser.debugger statement is skipped.