Closed bleurose closed 9 years ago
@bleurose
Have you tried putting the pause in its own it() function?
Like:
describe("enroll user page", function() {
it("should enroll a user", function() {
browser.get("http://myurl.com/enroll");
element(by.model("contact.firstName")).sendKeys("first");
element(by.model("contact.lastName")).sendKeys("last");
element(by.model("contact.companyName")).sendKeys("company001");
element(by.model("contact.phoneNbr")).sendKeys("8318313333");
element(by.model("contact.companyWebUrl")).sendKeys("www.test.com");
element(by.model("contact.email")).sendKeys("testemail+9999@gmail.com");
element(by.model("contact.password")).sendKeys("pswd:pswd");
element(by.model("contact.passwordConfirm")).sendKeys("pswd:pswd");
});
it("pauses", function() {
browser.pause();
});
it("Submit", function() {
element(by.css("form[name='addContactForm'] button.my-submit")).click();
});
});
tI tried that and the first TWO "it" tests passed but the third timed out with the same error as before. So that means that control is returning from the browser.pause() (it "passes") but the attempt to find the element form in the next step is failing because of the sync problem.
I assume that either I need to do something more to "resync" test with the page but I don't know what that would be. Is there some kind of resync method that is part of browser or protractor objects that could make this happen?
Thanks!
This error message means that Angular has some pending request on your page, such as a $http request or $timeout. Is there any way that the captcha request is creating that?
To get around this, you can turn off waiting temporarily:
browser.ignoreSynchronizaton = true;
element(by.css("form[name='addContactForm'] button.my-submit")).click();
browser.ignoreSynchronizaton = false;
Closing as I believe this is a specific support question, not a generic issue. Thanks!
I am trying to test an enrollment page which has a built-in "recaptcha" box to prevent "bots" from registering (I can't disable this behavior for testing - that would be ideal but I can't and in any case, I think the approach I am taking should work).
A simplified (non-PageObject) version of my code (-spec file) is as follows:
When I run this (including --troubleshoot), I get the following output up to the
browse.pause()
statement:At this point, I go to the browser and directly enter the recaptcha validation that is required. According to the documentation on pause(), I should be able to now continue with the application. But when I do that, it hangs and ultimately says that it has timed out trying to synchronize the page. This happens no matter how I exit the debug mode: I can use Ctl-C or I can just use "c" to go to the next statement as is shown below:
I think this may be a bug in pause(). Thank you for looking at this.