To test applications in multiple UI sessions on a single machine or to test multiple agents on a single machine, connect to multiple Open Agent instances on the machine. Every agent runs in its own UI-session. A UI session can be a Remote Desktop Protocol (RDP) connection or a Citrix-based connection.
Desktop desktopSession = new Desktop("hostname:port");Where hostname is the name of the machine on which the agent is running, and port is the unique port that you have specified.
Assume that the server machine that is hosting the UI sessions is named ui-srv. You can create three UI sessions by using the ports 22903, 22904, and 22905.
openAgent.exe -infoServicePort=22903
Do the same for the other two sessions with the respective ports 22904 and 22905.
Desktop desktopSession1 = new Desktop("ui-srv:22903"); Desktop desktopSession2 = new Desktop("ui-srv:22904"); Desktop desktopSession3 = new Desktop("ui-srv:22905");
public class TestMultiSession { Desktop d1 = new Desktop("ui-srv:22903"); Desktop d2 = new Desktop("ui-srv:22904"); Desktop d3 = new Desktop("ui-srv:22905"); @Test public void test() { BaseState basestate = new BaseState(); basestate.execute(d1); basestate.execute(d2); basestate.execute(d3); d1.<Window>find("//Window").typeKeys("Hello to session 1!"); d2.<Window>find("//Window").typeKeys("Hello to session 2!"); d3.<Window>find("//Window").typeKeys("Hello to session 3!"); } }