Simulating automated tests with standalone

Have spent three hours trying to figure out how to connect to standalone but have not yet succeeded but I know i will succeed. Have optionally thought about this alternative but seems also not to work out