Created On:  5 August 2010

When testing a browser with the Open Agent the xBrowser TechDomain is utilized along with the WIN32 TechDomain. However, when the xBrowser TechDomain is loaded it does not allow recognition of the Win32 controls eg. login controls.
In order to gain recognition of the Win32 controls you need to turn off the xBrowser TechDomain and only have the Win32 TechDomain loaded. It is possible to unload and load specific TechDomains at runtime but only when using Silk4J (JTF) or Silk4NET (NTF) scripts.

To do this in Silk4J you need the following code:

  // To load the win32 tech domain only
  desktop.detachAll();
  desktop.attach("*\\IEXPLORE.EXE", TechDomain.WIN32);
  
  
  // To reload relevant tech domains
  desktop.detachAll();
  desktop.attach("*\\IEXPLORE.EXE", TechDomain.WIN32, TechDomain.XBROWSER);

Note the first line turns off all TechDomains and then only loads the WIN32 Techdomain. You would place this before you want to manipulate the Win32 controls. Then the second line turns off all TechDomains and then loads both xBrowser and WIN32. You would place this after you have finished manipulating the Win32 controls so that you can continue with the testing of the browser.

The code needed for Silk4NET in VB.NET is:

  'To load the win32 tech domain only
  Agent.DetachAll()
  Agent.Attach("*\\IEXPLORE.EXE", TechDomain.WIN32)


  'To reload relevant tech domains
  Agent.DetachAll()
  Agent.Attach("*\\IEXPLORE.EXE", TechDomain.XBROWSER, TechDomain.WIN32)

Finally the code needed for Silk4NET in C# is:

  // To load the win32 tech domain only
  Agent.DetachAll();
  Agent.Attach("*\\IEXPLORE.EXE", TechDomain.WIN32);

  // To reload relevant tech domains
  Agent.DetachAll();
  Agent.Attach("*\\IEXPLORE.EXE", TechDomain.WIN32,TechDomain.XBROWSER);