You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some times GetPageSource method throws ElementNotAvailableException
ERROR: test_click_button (__main__.TestApp2)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:/Users/*/Desktop/fbautomation.py", line 158, in test_click_button
print(self.driver.page_source)
File "C:\Python27\lib\site-packages\selenium-2.45.0-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 438, in page_source
return self.execute(Command.GET_PAGE_SOURCE)['value']
File "C:\Python27\lib\site-packages\selenium-2.45.0-py2.7.egg\selenium\webdriver\remote\webdriver.py", line 175, in execute
self.error_handler.check_response(response)
File "C:\Python27\lib\site-packages\selenium-2.45.0-py2.7.egg\selenium\webdriver\remote\errorhandler.py", line 136, in check_response
raise exception_class(value)
WebDriverException: Message: System.Windows.Automation.ElementNotAvailableException: Element not available ---> System.Runtime.InteropServices.COMException: Operation timed out. (Exception from HRESULT: 0x80131505)
at UIAutomationClient.IUIAutomationElement.FindAllBuildCache(TreeScope scope, IUIAutomationCondition condition, IUIAutomationCacheRequest cacheRequest)
at System.Windows.Automation.AutomationElement.FindAll(TreeScope scope, Condition condition)
--- End of inner exception stack trace ---
at System.Windows.Automation.AutomationElement.FindAll(TreeScope scope, Condition condition)
at Winium.StoreApps.CodedUITestProject.WiniumElement.GetChildrens()
at Winium.StoreApps.CodedUITestProject.WiniumElement.AsXml()
at Winium.StoreApps.CodedUITestProject.CommandExecutors.GetPageSourceExecutor.DoImpl()
at Winium.StoreApps.CodedUITestProject.CommandExecutors.CommandExecutorBase.Do()
The text was updated successfully, but these errors were encountered:
Both FindAll and FindFirst are prone to this exception, which is raised when trying to find elements in WebView that has loaded its data recently, exception is thrown when methods try to build cache, so it might be due to trying to iterate visual tree while it is being rebuild by another thread.
Solves the problem. Needs further investigation. Most likely we will have to replace both FindFirst and FindAll calls with custom TreeWalker iteration method.
This will solve the problem with not being able to get page source for views with webviews and not being able to find element in webview due to same error.
Some times GetPageSource method throws ElementNotAvailableException
The text was updated successfully, but these errors were encountered: