Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element Not Available Exception #211

Open
noubar opened this issue Oct 10, 2024 · 2 comments
Open

Element Not Available Exception #211

noubar opened this issue Oct 10, 2024 · 2 comments

Comments

@noubar
Copy link
Contributor

noubar commented Oct 10, 2024

I am getting very often this error while using the reliable clicks, even it is catched
The SUT is a wpf tested with UIA2.

I will be investigating further within this issue.

ElementNotAvailableException: The target element corresponds to UI that is no longer available (for example, the parent window has closed).
   at MS.Internal.Automation.Misc.ThrowWin32ExceptionsIfError(Int32 errorCode)
   at MS.Internal.Automation.Misc.GetWindowLong(HWND hWnd, Int32 nIndex)
   at MS.Internal.Automation.HwndProxyElementProvider.IsWindowPatternWindow(HWND hwnd)
   at MS.Internal.Automation.HwndProxyElementProvider.System.Windows.Automation.Provider.IRawElementProviderSimple.GetPropertyValue(Int32 propertyId)
   at MS.Internal.Automation.UiaCoreApi.CheckError(Int32 hr)
   at System.Windows.Automation.AutomationElement.GetCurrentPropertyValue(AutomationProperty property, Boolean ignoreDefaultValue)
   at FlaUI.Core.FrameworkAutomationElementBase.TryGetPropertyValue[T](PropertyId property, T& value)
   at FlaUI.Core.AutomationElementXPathNavigator.get_LocalName()
   at MS.Internal.Xml.XPath.XPathAxisIterator.get_Matches()
   at MS.Internal.Xml.XPath.XPathChildIterator.MoveNext()
   at MS.Internal.Xml.XPath.ChildrenQuery.Advance()
   at MS.Internal.Xml.XPath.FilterQuery.Advance()
   at MS.Internal.Xml.XPath.ChildrenQuery.Advance()
   at MS.Internal.Xml.XPath.FilterQuery.Advance()
   at MS.Internal.Xml.XPath.XPathSelectionIterator.MoveNext()
   at FlaUI.Core.AutomationElements.AutomationElement.FindFirstByXPath(String xPath)

@noubar noubar changed the title Element Not Available Error Element Not Available Exception Oct 10, 2024
@noubar
Copy link
Contributor Author

noubar commented Oct 10, 2024

If I edit this line and remove the ElementNotAvailableException, and expect anything instead the problem will disappear.

https://github.com/GDATASoftwareAG/robotframework-flaui/blob/main/src/FlaUILibrary/flaui/module/element.py#L232

@noubar
Copy link
Contributor Author

noubar commented Oct 16, 2024

I have also seen that i had a typo at repeat timeouts of click close keywords
instead of 1000 ms they were 1 ms. which was never intended.
I will correct them in pr

noubar added a commit to noubar/robotframework-flaui that referenced this issue Oct 16, 2024
Nepitwin pushed a commit that referenced this issue Nov 8, 2024
* #211 click close issue fix

* Changelog Update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant