Need help about can't get text pattent

Aug 20, 2014 at 1:02 PM
Edited Aug 20, 2014 at 1:03 PM
Hi all.
I have an problem. I'm buid test code for metro app

AutomationElement aeTextSyncChild = aePopup.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.AutomationIdProperty, "textSync", PropertyConditionFlags.IgnoreCase));

TextPattern tp = (TextPattern)aeTextSyncChild.GetCurrentPattern(TextPattern.Pattern); => error here

When i run test code in an device with VS 2012 utilmate / Windows 8.1 64bit update 4. this code work fine.
But when i try run on other device (VS 2012 Premium / Widows 8.1 64 bit ). It can't work.
This is error :

System.InvalidOperationException' の初回例外が UIAComWrapper.dll
'System.Reflection.TargetInvocationException' の初回例外が mscorlib.dll

it's occur when i get Text Pattern.
How can i fix it ?