I am trying to find the test objects by process id or handle ,but failed to get them ,and I don't know why.Please you guys help me.the following is my code (VB.net):
Dim ntpdProcess() As Process
Dim pid As Integer
Dim hnd As Long
'Dim fetionWin1 As TopLevelSubitemTestObject
ntpdProcess= Process.GetProcessesByName("notepad")
pid = ntpdProcess(1).Id()
hnd = ntpdProcess(0).Handle

'--return 2 (I have lounched two Notepad process on my computor)

Dim root As RootTestObject
Dim ftWin() As TestObject
root = RootTestObject.GetRootTestObject()
'ftWin = root.Find(AtList(AtProperty(".processId", pid)))
ftWin = root.Find(AtList(AtProperty(".processId", pid), AtDescendant(".domain", "Win")))
'ftWin = root.Find(AtChild("Handle", hnd, ".domain", "Win"))

'--return 0(Failed to find a testObject, why?)
Thanks in advance!