Wikis - Page

How to resolve the error “SilkTest.NTF.ObjectMapIdentifierNotFoundException: Identifier was not found in the Object Map"?

0 Likes

The above error will occur if you attempt to execute a SilkTest VB.NET script on a remote machine (using the “Agent.Connect” call) and the script uses ‘Object Maps ‘. For example, the following sample script.


Imports SilkTest.Ntf.XBrowser
Public Module Main
Dim _desktop As Desktop = Agent.Desktop

Public Sub Main()
   Agent.Connect("remoteHost")
   With _desktop.BrowserApplication("WebBrowser")
      With .BrowserWindow("BrowserWindow")
          .DomButton("bSubmit").Click(MouseButton.Left, New Point(124, 12))
          .DomTextField("QTY_BOOTS").TypeKeys("<#1>")
          .DomButton("bSubmit").Click(MouseButton.Left, New Point(60, 4))
     End With
  End With

End Sub
End Module


will return the error “SilkTest.NTF.ObjectMapIdentifierNotFoundException: Identifier ‘WebBrowser” was not found in the Object Map”.

The reason why is that there is a limitation in the SilkTest Workbench which means that when you use “Agent.Connect” to a remote machine you will have to use raw locators instead of object map entries as the remote agent you are connected to does not know anything about the local object map. Therefore you will either have to


1) Replace your object map entries with the corresponding raw locators; for example:

With _desktop.BrowserApplication("WebBrowser")
   With .BrowserWindow("BrowserWindow")

Would become:

With _desktop.BrowserApplication("/BrowserApplication")
   With .BrowserWindow("//BrowserWindow")


2) Go to “Tools | Options | Record | General” and set “Record Object Maps” to No; before recording your VB.NET script once again

Labels:

Support Tips/Knowledge Docs
Support Tip
Comment List
  • Now ..

    Crashing in SilkTest WorkBench 13.0.

    What can I do ? I trying to automate a application using SilkTest WorkBench 13.0 +VB.Net Scripting.

    During the script execution some times my application getting hanged or crashing completely, How to handle (Try - Catch) in SilkTest WorkBench 13.0.

    How to overcome this issue.....

    Could you please help us in this.

    Note : In SilkTest WorkBench 12.0 I haven't problems , only in SilkTest WorkBench 13.0

    Code:

    With .BrowserWindow("BrowserWindow")  

    .DomTextField("txtNroRUC").SetText(strRuc)                                                                                            

    .DomButton("btnConsultar").Click(MouseButton.Left, New Point(28, 10))

    End With

    'INICIO RUC CON DEUDA VENCIDA O RUC INVALIDO

     Try

    If .Dialog("//Dialog").Exists Then

    .Dialog("//Dialog").PushButton("//PushButton[@caption='Aceptar']").Select()

    .DomElement("//IMG[@id='imgLimpiarEmpresa']").Click(MouseButton.Left, New Point(6, 7))

    GoTo RUCNOVALIDO

    End If

     Catch ex As Exception

     End Try

    Thanks,

    Luis Peralta

Related
Recommended