Help with error, Unable to find element on closed window

issues

#1

Hey everyone,
I am trying to do a very simple task of just pulling data for a stock I am researching. I go to finance yahoo, then search my stock. Once I am there I try to pull the data using XPATH. I get the following error "Unable to find element on closed window (WARNING: The server did not provide any sacktrace information).

Has anyone had this issue? If so, what do I do to fix it?


"Unable to find element on closed window (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 13 milliseconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: ', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:10825/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: ff2b58e0-cc1c-43d8-9d28-03ad57c16db1
*** Element info: {Using=xpath, value=//td[@data-reactid='361']}
Command duration or timeout: 586 milliseconds
Build info: version: '8.3.5-SNAPSHOT', revision: 'unknown', time: '2017-06-14 10:10:21'
System info: host: '', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: com.freedomoss.crowdcontrol.webharvest.selenium.wrapper.RemoteDriverWrapper
Capabilities [{sikuliThreshold=0.8, webdriver.remote.sessionid=797ff5ac-cd27-4ad3-84c5-490a9c8ed8e3, CLOSE_ALL_WINDOWS=false, browserName=universal, takesScreenshot=true, javascriptEnabled=true, SEARCH_ALL_WINDOWS=true, platform=WINDOWS}]
Session ID: 797ff5ac-cd27-4ad3-84c5-490a9c8ed8e3
*** Element info: {Using=xpath, value=//td[@data-reactid='361']}
  org.openqa.selenium.NoSuchWindowException: Unable to find element on closed window (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 13 milliseconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: '', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:10825/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: ff2b58e0-cc1c-43d8-9d28-03ad57c16db1
*** Element info: {Using=xpath, value=//td[@data-reactid='361']}
Command duration or timeout: 586 milliseconds
Build info: version: '8.3.5-SNAPSHOT', revision: 'unknown', time: '2017-06-14 10:10:21'
System info: host: ', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: com.freedomoss.crowdcontrol.webharvest.selenium.wrapper.RemoteDriverWrapper
Capabilities [{sikuliThreshold=0.8, webdriver.remote.sessionid=797ff5ac-cd27-4ad3-84c5-490a9c8ed8e3, CLOSE_ALL_WINDOWS=false, browserName=universal, takesScreenshot=true, javascriptEnabled=true, SEARCH_ALL_WINDOWS=true, platform=WINDOWS}]
Session ID: 797ff5ac-cd27-4ad3-84c5-490a9c8ed8e3
*** Element info: {Using=xpath, value=//td[@data-reactid='361']}
  	at sun.reflect.GeneratedConstructorAccessor90.newInstance(Unknown Source)
  	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
  	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
  	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:646)
  	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:331)
  	at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:468)
  	at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
  	at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:323)
  	at com.workfusion.rpa.helpers.RPA.getElement(RPA.java:641)
  	at com.workfusion.rpa.helpers.RPA.$(RPA.java:573)
  	at com.workfusion.studio.rpa.recorder.model.action.web.GetByWebSelectorAction.getStringValue(GetByWebSelectorAction.java:45)
  	at com.workfusion.studio.rpa.recorder.model.action.web.GetByWebSelectorAction.getValueByType(GetByWebSelectorAction.java:33)
  	at com.workfusion.studio.rpa.recorder.model.action.web.GetByWebSelectorAction.executeAction(GetByWebSelectorAction.java:28)
  	at com.workfusion.studio.rpa.recorder.model.action.ActionWithDelay.execute(ActionWithDelay.java:27)
  	at com.workfusion.studio.rpa.recorder.processor.ActionFlowPlayer.execute(ActionFlowPlayer.java:317)
  	at com.workfusion.studio.rpa.recorder.processor.ActionFlowPlayer.processAction(ActionFlowPlayer.java:256)
  	at com.workfusion.studio.rpa.recorder.model.action.SwitchWindowAction.executeNestedActions(SwitchWindowAction.java:63)
  	at com.workfusion.studio.rpa.recorder.model.action.SwitchWindowAction.executeAction(SwitchWindowAction.java:34)
  	at com.workfusion.studio.rpa.recorder.model.action.ActionWithDelay.execute(ActionWithDelay.java:27)
  	at com.workfusion.studio.rpa.recorder.processor.ActionFlowPlayer.execute(ActionFlowPlayer.java:290)
  	at com.workfusion.studio.rpa.recorder.processor.ActionFlowPlayer.processAction(ActionFlowPlayer.java:256)
  	at com.workfusion.studio.rpa.recorder.model.action.BaseNestedAction.executeAction(BaseNestedAction.java:22)
  	at com.workfusion.studio.rpa.recorder.model.action.ActionWithDelay.execute(ActionWithDelay.java:27)
  	at com.workfusion.studio.rpa.recorder.processor.ActionFlowPlayer.execute(ActionFlowPlayer.java:317)
  	at com.workfusion.studio.rpa.recorder.processor.ActionFlowPlayer.processAction(ActionFlowPlayer.java:256)
  	at com.workfusion.studio.rpa.recorder.processor.ActionFlowPlayer.lambda$1(ActionFlowPlayer.java:120)
  	at java.util.ArrayList.forEach(ArrayList.java:1249)
  	at com.workfusion.studio.rpa.recorder.processor.ActionFlowPlayer.lambda$0(ActionFlowPlayer.java:120)
  	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  	at java.lang.Thread.run(Thread.java:745)
"

#2

@matthew - please post your recording here

You can zip the recording folder and attach it here


#3

Hi @matthew

Please note that yahoo finance is a dynamic website which completely changes the underlying HTML with javascript while rendering and you may simply no have @data-reactid=‘361’ element in the rendered version of the page.

The easiest for you would be to open the page in Firefox portable that we ship with RPA Express, right click on the element you want to extract and see what xpath it’s suggesting.

BTW what browser do you use?


#4

@azinchuk The file is to large for me to upload, its 17Megs. because of pictures I assume. Here is a picture of it.

@mabramchik Thats what I did, I used firefox and pull the XPATH which was like the image below. I see what you mean though, the number has changed since the last time I was on the site. I am currently using IE because firefox and chrome never loads the page completely. Its because of all the ADs on the sites and the bot always times out waiting on the site to load. I guess I will just have to find another site to pull the data from.


#5

Hi, to avoid issues with huge file, could you plese share for us an single separate image with Xpath selected under Firefox ?
For example screenshot from Yahoo Finance where the xpath was taken.