Attach Method (AgentClass)




Attaches to the given application. Enables you to specify an additional command-line pattern and tech domain.


Attach (executablePattern [, commandLinePattern, techDomains])
Variable Description
executablePattern The executable name of the application. The pattern may include the wildcards '?' and '*' which match one or none to many characters respectively. Examples: myApplication.exe, myApplica?ion.exemyApp*.exe. STRING.
commandLinePattern Optional: This pattern is matched against the command line arguments of the application. This is useful when multiple instances of an application, for example javaw.exe, are running, but only some of them should be tested. For Java applications, the command line pattern could include the name of a characteristic JAR or the main class, for example *org.MyMainClass. You can use null to specify no command line pattern when you want to load specific tech domains. STRING.
Optional: The tech domains to load in the application. Typically, this parameter is only used by technical support. As a best practice, do not specify a tech domain. If you do not specify a tech domain, all available tech domains are loaded. The available values are:
  • Flex
  • Java
  • Rumba
  • SAP
  • Silverlight
  • Swing
  • JavaSWT
  • WIN32
  • Windows Forms
  • WPF
  • xBrowser



The following example attaches to the Notepad application:
The following example shows how to use the command-line pattern to attach to a specific instance of a process when multiple instances of the application are running:
Agent.Attach("javaw.exe", “*org.MyMainClass”)
The following example shows how to attach to Internet Explorer and load the Win32 tech domain:
Agent.Attach("iexplore.exe", null, {"WIN32"})