Hi I am writing an application which needs to automate some tasks on the Google AdWords website.
After logging into AdWords, I am getting the exception "Too deep recursion while parsing (script in javascript:"" from (-1, -1) to (-1, -1)#9413)"
I have set up a test AdWords account, which can be used to reproduce the error. Below is my code.
public static void main(String[] args) {
try {
final WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_11);
webClient.getOptions().setUseInsecureSSL(true);
webClient.getOptions().setAppletEnabled(false);
webClient.getOptions().setJavaScriptEnabled(true);
final HtmlPage page = webClient.getPage("https://adwords.google.com");
HtmlTextInput email = null;
HtmlPasswordInput password = null;
HtmlSubmitInput loginBtn = null;
DomElement element = page.getElementById("Email");
if (element instanceof HtmlTextInput) {
email = (HtmlTextInput)element;
}
element = page.getElementById("Passwd");
if (element instanceof HtmlPasswordInput) {
password = (HtmlPasswordInput)element;
}
element = page.getElementById("signIn");
if (element instanceof HtmlSubmitInput) {
loginBtn = (HtmlSubmitInput)element;
}
if (email != null && password != null && loginBtn != null) {
email.setValueAttribute("htmlunittester@gmail.com");
password.setValueAttribute("htm1un1tte5ter");
HtmlPage loggedIn = loginBtn.click();
int runningScripts = webClient.waitForBackgroundJavaScriptStartingBefore(60000);
}
webClient.closeAllWindows();
} catch (Exception ex) {
ex.printStackTrace();
}
}
Thanks for the reply, but I have already found a different solution.
On Sat, Apr 4, 2015 at 12:04 PM, RBRi rbri@users.sf.net wrote:
Related
Bugs:
#1651Hi Gavin,
sorry for the long delay before have a real look at your issues.
Have tried your sample code and it works without problems using the latest code.
Did some additional tests and was able to login but i always reach the 'Verify it'S you' page. Based on this i'm not sure if the problem is really gone.
Another option is that google has changed something in between.
Can you pls verify that you got the same results.
Thanks for using HtmlUnit.
Ok, thanks for your feedback, will close this.