IMPORTANT NOTICE: As of 21 February, anything posted in this community WILL NOT BE MIGRATED to our new community site. We have pulled all user information and data from this site and are now in an approximately week long process of importing users, roles, and data to our new site. We are leaving this site open and active so you can post and hopefully get a response until the migration is complete. Once complete, the URL that currently takes you to this site will take you to our new site so your bookmarks will work as always. Please read the information on a New Login Process
The normal method of connecting to a local machine during distributed testing is to use the SetMachine statement e.g.
[ ] string sLocalMachine = "MyPC" // host network name [ ] HMACHINE hLocalMachine=GetMachine() [ ] SetMachine(hLocalMachine) [ ] //Do the testing here [ ] Disconnect(hLocalMachine) If you wish to use the Connect() statement, you must ensure that Agent on the local machine is set to local | TCP/IP under Options | Runtime on the SilkTest menu. The following statement will then work:
[ ] HMACHINE hLocalMachine=GetMachine() [ ] Disconnect(hLocalMachine) [ ] hLocalMachine = Connect () [ ] // Do the testing here [ ] Disconnect(hLocalMachine)
You do not require the machine name parameter to connect to the local PC.
Note that you must disconnect the current Agent before attempting to connect to the local machine. This also applies if connecting to the local machine is the first connection action in the distributed test. It is required because SilkTest 2008 launches and connects to the local Agent before any further actions are taken.