Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9109183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:58:56+00:00 2026-06-17T02:58:56+00:00

I am trying to use the following code from http://www.thoughtworks-studios.com/twist/2.3/help/how_do_i_handle_ajax_in_selenium2.html : String xpathExpr =

  • 0

I am trying to use the following code from http://www.thoughtworks-studios.com/twist/2.3/help/how_do_i_handle_ajax_in_selenium2.html:

            String xpathExpr = "//div[@id='contentPane']/div[@class='g-x-Aa  ud-Aa']/div[@class='Nj mu']/div[@class='ez vcard']/div[@class='l-Gy Vra']/div[@class='qga']/div[@class='g-Ua-z9']/div[@class='WAa']/div[@class='Yia']/div[@class='twa Vxa']/div[@class='zD us']/div[@class='hx a-f-e']"; 
    //String xpathExpr = "//div[@id='contentPane']/div[@class='g-x-Aa ud-Aa']";
    By by = By.xpath(xpathExpr);
    WebDriverWait wait = new WebDriverWait(driver, 20);
    WebElement elem1 = wait.until(visibilityOfElementLocated(by));
    System.out.println(Util.getInnerHtml(driver, elem1));

            public static String getInnerHtml(WebDriver driver, WebElement element) {
        return (String)((JavascriptExecutor)driver).executeScript("return      arguments[0].innerHTML;", element); 
    }

To test some ajax page. The weird thing is that it works the first time but never works after that. Besides the DOM element is loaded in firefox and is clearly visible yet, the program is stuck at the innerhtml part and sometimes wait.until part.

Any idea how to debug and troubleshoot this problem?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:58:58+00:00Added an answer on June 17, 2026 at 2:58 am

    Ok problem solved. The problem with the CSS class name in xpath I think.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the PredicateBuilder, as described here - http://www.albahari.com/nutshell/predicatebuilder.aspx The following code
I'm trying to use Qt to download the html code from the following url:
I'm trying to use the following plugin for date picking: http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/index.html And I'm trying
I am trying to use a previously created database following the tutorial: http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ I
I am trying to output audio samples, and do so with cswavplay from http://www.codeproject.com/KB/audio-video/cswavplay.aspx
I'm trying to scrape data from the table at the following url: http://www.nfpa.org/itemDetail.asp?categoryID=953&itemID=23033 The
I'm trying to read the following xml file from spotify: http://ws.spotify.com/search/1/track?q=sail+awolnation I want to
I am trying to use the following code, to display $formcode, which is the
I'm trying to use the following code # LOAD XML FILE $XML = new
I'm trying to use the following code to make an image fadeOut and, only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.