Menu

#1651 Too deep recursion while parsing (script in javascript:"" from (-1, -1) to (-1, -1)#9413)

Latest SVN
closed
RBRi
None
1
2015-04-05
2014-10-27
No

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();
        }
    }

Related

Bugs: #1651

Discussion

  • RBRi

    RBRi - 2015-04-04
    • status: open --> accepted
    • assigned_to: RBRi
     
    • Gavin Rifkind

      Gavin Rifkind - 2015-04-04

      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:

      • status: open --> accepted
      • assigned_to: RBRi
      • Comment:

      Hi 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.


      Status: accepted
      Group: Latest SVN
      Created: Mon Oct 27, 2014 09:18 AM UTC by Gavin Rifkind
      Last Updated: Mon Oct 27, 2014 09:18 AM UTC
      Owner: RBRi

      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();
          }
      }
      

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/htmlunit/bugs/1651/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #1651

  • RBRi

    RBRi - 2015-04-04

    Hi 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.

     
  • RBRi

    RBRi - 2015-04-05

    Ok, thanks for your feedback, will close this.

     
  • RBRi

    RBRi - 2015-04-05
    • status: accepted --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB