Forum Discussion

amit_2006's avatar
amit_2006
Occasional Contributor
5 years ago

Exists and Find Child Property didn't work

Dear Team,

Today suddenly i got below type mismatch issue in various screen while executing script .It was working fine last night and also working fine in other workstation today  without change . I really felt so bad because I am unable to figure out route cause and also same script worked well in last night  and other work station.I have reinstalled test complete 2-3 time but i didn't get answer why still happening this issue .

I tried to debug function and realized that it is giving error when 'Exists' method called .When i debug code line by line it is working fine but when i removed debug point then it is still giving same error .

Could you please help me on this?

Thanks you 

Amit

  • sonya_m's avatar
    sonya_m
    5 years ago

    Thanks everyone for helping here.

    Hi amit_2006 ! There's been a lot of suggestions in this thread. I think that contacting support directly is the best next step if you are still facing this. This definitely needs deeper investigation. The Community would be very thankful if you post the final solution in this thread.

  • kevin_kapell's avatar
    kevin_kapell
    Frequent Contributor

    Need to see the rest of the code.

    How is the variable link mapped?

    • amit_2006's avatar
      amit_2006
      Occasional Contributor

      Team,Thank you for giving quick response.Same script worked well in other workstation for same application but not mine workstation now .that same script worked well in last night but today i didn't change anything but getting type mismatch error. 

      Function ClickDispTable_MenuItem(linkText)
      Dim table,propArray, valArray,link
      Set table = Sys.Process("Student").WinFormsObject("StudentMain").WinFormsObject("_WebBrowserHost").WinFormsObject("WebBrowser", "").WinFormsObject("Shell Embedding", "").Window("Shell DocObject View", "", 1).Window("Internet Explorer_Server", "", 1)_
      .Page("ReleaseEnvironment").Frame("FrameMain1").Form("MainMenu")
      propArray = Array("innerText","ObjectType")
      valArray = Array(linkText,"Cell")
      Set link = table.FindChild(propArray,valArray,1000) 'Visible , Enabled
       If ( link.Exists) Then 'getting error on this line without debug but worked well with debug point
       Call link.Click
      End If
      End Function