Automation Element no longer avilable exception

1,841 views
Skip to first unread message

Chaitanya Channella

unread,
Mar 12, 2014, 12:24:29 PM3/12/14
to teststa...@googlegroups.com
One of my tests is failing ,sometimes the test passes but most of the times it fails with the below exception although the parent window is open White can't see the object
 

TestStack.White.WhiteException : Error occured while geting ControlType=edit,AutomationId=AssignmentReference ----> System.Windows.Automation.ElementNotAvailableException : The target element corresponds to UI that is no longer available (for example, the parent window has closed). at MS.Internal.Automation.ElementProxy.GetPropertyValue(Int32 property)

at

TestStack.White.UIItems.UIItemContainer.Get(SearchCriteria searchCriteria, TimeSpan timeout) at TestStack.White.UIItems.UIItemContainer.Get(SearchCriteria searchCriteria) at Trafigura.Modules.UITests.Global.GlobalHelpers.GetByAutomationId(Window window, String id) in GlobalHelpers.cs: line 32

 

Any help would be greatly appreciated

Jake Ginnivan

unread,
Mar 17, 2014, 3:04:39 PM3/17/14
to Chaitanya Channella, teststa...@googlegroups.com

This happens when the underlying element is recreated (due to virtualisation, hide/show parent window etc).

 

When this happens you should get the element again using white, rather than keeping a variable somewhere which is still pointing at an old automation element.

 

Hope that makes sense.

--
You received this message because you are subscribed to the Google Groups "TestStack.White" group.
To unsubscribe from this group and stop receiving emails from it, send an email to teststack_whi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Krithiga V

unread,
Nov 5, 2015, 6:29:41 PM11/5/15
to TestStack.White, chann...@gmail.com
Hi Jake,

I am new to Test Stack White and C# .NET. I am checking the status of an application before and after an action. (like the status is "Initial" before an action and "Success" after action). I have separate class file to verify the status and I am calling the same functions before and after the action. And receive the same error message. Now, what should I do? You mentioned to get the element again, how can I do this? 

Thank you,
Krithiga

Rameshwari M

unread,
Nov 6, 2017, 1:52:10 AM11/6/17
to TestStack.White
Hi , 
I am also facing same issue . I am trying to get the window details when i click on the pane. but it is throwing the exception
"The target element corresponds to UI that is no longer available (for example, the parent window has closed).". Can u please help me to resolve this issue.

Thanks
Rameshwari
Reply all
Reply to author
Forward
0 new messages