2

I have to perform some tests to web application with interesting interface. I faced with the following issue: there is a process with progress bar and while process is not finished, selenium couldn't interact with page. Progress bar percentage and status message are received by page thru very long ajax. It works very interesting:

  1. Page sends request to start process (aka form submit)
  2. Page receives data with popup window and shows it
  3. Page sends request to get progress bar status
  4. Page receives every few seconds a part of response with status and current progress
  5. Page receives the end of response (aka code 200)

So, while process is running, page is 'downloading' the response. It this period, selenium couldn't execute (or something else) its scripts in page.! Selenium perform all actions (also, searching elements, clicks on it and so on) thru executing some js in page context

Note: document.readyState == 'complete', but... browser shows like it is loading something (yes, it is, it is loading the response).

I'm not sure that I can somehow modify the page to avoid such 'locking'. It is possible to tune selenium settings to allow him to work while something is loaded? I'm interested in reading in real-time the progress status.

  • Try to get the element ID of the loading, you need to explicitly handle this, add the check till the throwber gets disappear, ex:write a method while does the pauses the test case ex:waitForElementDisapper(By.id or css('locator of loading something')) – saikrishna Dec 22 '15 at 7:00
1

If you are geting a pop-up window that shows a progress bar, you really need to do a driver.switchTo(windowHandle) to switch to that window and monitor the progress bar. Then, when the popup is done (or automatically closes) make sure you switch back to the main window handle. I think that is why it appears your Selenium can't do anything, because it is trying to act on the wrong window handle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.