1
votes

Robot framework is keyword base testing framework. I have to test remote server so i need to do some prerequisite steps like

 i)copy artifact on remote machine
 ii)start application server on remote
 iii) run test on remote server

Before robot framework we do it using ant script

I can run only test script with robot . But Can we do all task using robot scripting if yes what is advantage of this?

4

4 Answers

6
votes

Yes, you could do this all with robot. You can write a keyword in python that does all of those steps. You could then call that keyword in the suite setup step of a test suite.

I'm not sure what the advantages would be. What you're trying to do are two conceptually different tasks: one is deployment and one is testing. I don't see any advantage in combining them. One distinct disadvantage is that you then can't run your tests against an already deployed system. Though, I guess your keyword could be smart enough to first check if the application has been deployed, and only deploy it if it hasn't.

One advantage is that you have one less tool in your toolchain, which might reduce the complexity of your system as a whole. That means people can run your tests without first having installed ant (unless your system also needs to be built with ant).

1
votes

If you are asking why you would use robot framework instead of writing a script to do the testing. The answer would be using the framework provides all the metrics and reports you would otherwise script for yourself.

Choosing a frame work makes your entire QA easier to manage, save your effort to write code for the parts that are common to the QA process, so you can focus on writing code to test your product.

Furthermore, since there is an ecosystem around the framework, you can probably find existing code to do just about everything you may need, and get answers to how to do something instead of changing your script.

0
votes

Yes, you can do this with robot, decently easily.

The first two can be done easily with SSHLibrary, and the third one depends. Do you mean for the Robot Framework test case to be run locally on the other server? That can indeed be done with configuration files to define what server to run the test case on.

0
votes

Here are the commands you can use from SSHLibrary of Robot Framework.

copy artifact on remote machine

  1. Open Connection
  2. Login or Login With Private Key
  3. Put Directory or Put File

start application server on remote

  1. Execute Command

For Running Tests on Remote Machine(Assuming Setup is there on machine)

  1. Execute Command (use pybot path_to_test_file)

You may experience connections losts,but once tests are triggered they will be running on remote machine