Ask a Question

Exists and Find Child Property didn't work

SOLVED
amit_2006
Occasional Contributor

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

14 REPLIES 14

Hi,

 

As per screenshot, the problem occurred within your custom UPN script extension.

You need to debug it in order to understand what went wrong.

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
amit_2006
Occasional Contributor

Thank you for reply but I don't think so .Because same script worked well in another team workstation where windows didn't update .Same script worked well in test complete 14 version also. No one single project worked well with test complete 9 after windows update .Before Windows version update , it worked well

 

I have only option for using test complete 9 and looking for those solution if Test complete 9 can handle script execution with latest version of test complete.

 

Please don't hesitate if you are unclear and want to help me for removing my pain.

 

Thank You

Amit G

 

Hi,

 

Screenshot that you posted clearly mentions UPN_CoreLib_CommonCode.vbs (line 80, column 2) and UPN_CoreLib.tcx script extension. I guess that UPN_CoreLib_CommonCode.vbs file is a part of script extension.

The fact that the problem occurs only on machines with updated Windows means that something was changed in Windows itself and this change breaks your existing code. No one will be able to help you more without seen your code and knowing execution context.

So you need to locate the line of your test code (not extension, but regular code in script unit) that causes the problem and post here this line with surrounding context, as well as the problematic code line from script extension with its surrounding context.

Otherwise you may debug your code yourself and figure out why your code breaks on the machine with updated Windows.

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
amit_2006
Occasional Contributor

Thank you always for giving quick reply .I have placed below code for your satisfaction because i told many times that same script working fine in other workstation which have old windows 10 version and updated test complete 14 version. I just placed small code but i am getting same error in many scripting area where it worked well before windows update .it is not supporting Exists and Set object property when ever I use .

 

Could you please help me for resolving this issue with latest windows update version.

 

Sub Main_Testing
' Err.Clear
' On Error Resume Next
'  To click main menu item

ClickDispTable_MenuItem("Main Menu")

End Sub

Function ClickDispTable_MenuItem(linkText)
Dim table,propArray, valArray,link
Call SelectSystem
Set table = Sys.Process("A").WinFormsObject("AMain").WinFormsObject("_WebBrowserHost").WinFormsObject("WebBrowser", "").WinFormsObject("Shell Embedding", "").Window("Shell DocObject View", "", 1).Window("Internet Explorer_Server", "", 1)_
.Page(ServerURLname).Frame("FrameMain1").Form("MainMenu")
propArray = Array("innerText","ObjectType")
valArray = Array(linkText,"Cell")
Set link = table.FindChild(propArray,valArray,50)
If (link.Exists) Then :- causing error when i use local and test complete script function
Call link.Click
End If
End Function

Hi,

 

a) > ' On Error Resume Next

Is the On Error Resume Next statement really commented in your production code? Can you double-check it?

Use of On Error Resume Next is one of worst practices and is highly not recommended. Especially when placed at the beginning of function.

 

b) Does the code that you provided corresponds to the code for the script extension mentioned on the screenshot that you posted initially?

 

c) Does failure occurs exactly on the 'If (link.Exists) Then' line? Can you double-check that the previous 'Set link = table.FindChild()' line succeeds? (And 'On Error Resume Next' statement is not in effect.)

 

Otherwise the code looks OK and I have no better idea at the moment but to debug it on the problematic machine.

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
cancel
Showing results for 
Search instead for 
Did you mean: