Created By  inflectra.adam Tuesday, April 23, 2013
Sometimes you want to be able to open a browser window (e.g. Internet Explorer) and execute JavaScript commands directly against the DOM objects rather than using the Rapise Learned objects. This article explains the recommended way of doing this.

The important part is to use Navigator.Find(...) instead of Navigator.Open(...) because 'Find' connects to the browser instance in such a way that it is ready for subsequent calls to Navigator.ExecJS(...)

Normally this method is not used from outside Rapise, so we have to pass it 3rd and 4rth parameters to meet its needs. The 2nd parameter is an URL to be opened:

//Open up the IE browser window
Navigator.Find('/html', '',null, {executable:"iexplore.exe"});
// Now do whatever is needed with IE instance

// Now we want to close the IE window

// We utilize the known IE hack to close a window without receiving prompt

Navigator.ExecJS("'', '_self', ''); window.close();");
g_ieNavigator.process = null;


Article Info
  • Last Updated: 4/23/2013
  • Article ID: KB46
  • Views: 4406