IP communicating scripts?

Ask general questions here.
User avatar
Posts: 89
Joined: Mon Apr 05, 2010 8:44 pm
Location: Austin, Texas

IP communicating scripts?

Post by Gunner1980 » Tue Jun 07, 2011 7:01 pm

Has anyone developed any test scripts that communicate between computers over IP? What I am wanting to do is develop two test scripts that work in tandem.

On system 1 I want to initiate items using a ranorex scripts.

On system 2 I want to validate the items being entered.

I want to have two test scripts that communicate over IP so when script 1/system 1 does something it tells script 2/system 2 to validate it. Once system 2/script 2 validates it it then tells system 1 script 1 to move onto the next step. Has anyone done anything like this before? Looking for insight on how to go about designing this.

User avatar
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: IP communicating scripts?

Post by Ciege » Tue Jun 07, 2011 7:24 pm

Well, you have the full suite of .NET available to you. So if you are comfortable writing on the TCP layer then it should be pretty straight forward. Or if you are not as comfortable writing TCP you can also use the "file method" where one machine waits for a file to appear somewhere before it continues and the other machine writes a file somewhere to tell the other machine to continue and what to do.

File method:
Define a location for where to save/read the file (like a network share etc...)
Machine 1 starts
Machine 2 starts
M1 pauses and checks a well defined location for a file
M2 continues work then write a file to the well defined location to tell M1 to continue
M1 finds the file and continues as directed

TCP method:
Define the IP address of each machine
Teach each script what the IP addresses are
Machine 1 starts
Machine 2 starts
M1 pauses and listens on a specified port for communication
M2 continues work then calls M1 over TCP on a specific port to send a continue step
M1 hears the communication and continues
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!


User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: IP communicating scripts?

Post by Support Team » Thu Jun 09, 2011 7:59 pm

You can also use .NET Remoting which facilitates sending messages between computers to simple method calls. See following article for a sample:
http://www.codeproject.com/KB/IP/remoti ... ample.aspx

Note: Make sure that you perform all Ranorex code on an STA thread, not on the thread created by .NET Remoting on the receiver side (which uses MTA threads from standard .NET ThreadPool). Otherwise some technologies might not work correctly.

Ranorex Team