DKarap / web-driver

crawler that use the webdriver, ghostdriver/phantomJS
0 stars 1 forks source link

Check webDriver exception durring the stability test on Amedoo and handle them on WebDriver #14

Closed DKarap closed 10 years ago

DKarap commented 10 years ago

Cases that we might need to handle for exceptions:

  1. GetLinks: at the point we get info for each link; there can have shits like: Element is no longer attached to the DOM
DKarap commented 10 years ago

2.The implicitWait capabilities may throw timeOutExceptions that are not handle. Thus the WebDriverException catch it and terminates the process

DKarap commented 10 years ago

WHERE WE FAILED TO GET A URL AND THEN TRY TO CLICK AN ELEMENT THEN WE GTH A TIMEOUT EXCEPTION: Timeout during page loading:http://weblog.independer.nl/vacature/ Exception:{"errorMessage":"URL 'http://weblog.independer.nl/vacature/' didn't load. Error: 'timeout'","request": Command duration or timeout: 5.16 seconds

org.openqa.selenium.TimeoutException: {"errorMessage":"Click failed: timeout","request":

DKarap commented 10 years ago

Exceptions:

org.openqa.selenium.StaleElementReferenceException: getLinks() getVisualInfo() org.openqa.selenium.remote.UnreachableBrowserException: get() getPageSource() FATAL org.openqa.selenium.NoSuchElementException: getTitle OK org.openqa.selenium.WebDriverException: getTitle() org.openqa.selenium.NoSuchWindowException: get(url),getPageSource(); OK org.openqa.selenium.TimeoutException: clickElement() org.openqa.selenium.remote.SessionNotFoundException: get(url) - FATAL!!!

DKarap commented 10 years ago

Main exceptions happened due to malakies of ghostdriver:

  1. org.openqa.selenium.remote.UnreachableBrowserException: +> https://github.com/detro/ghostdriver/issues/140 @this is handled by catch the exception when we quit the driver
  2. org.openqa.selenium.remote.SessionNotFoundException
  3. org.openqa.selenium.StaleElementReferenceException 3.1. handle the exception when we selectALL the options from a page
DKarap commented 10 years ago

This is done by catching the webdriver exceptions at the main core modules