Showing posts with label remotelibrary. Show all posts
Showing posts with label remotelibrary. Show all posts

Wednesday, September 9, 2015

Jython remote library

Remote library for Jython/Jybot with sikuli

Machine 1:
1. Installed jython 2.5.2, Jybot, Sikuli
2. Install robot remote server using command "jython setup.py install"
       Note: Download robotremoteserver.tgz file and install
3. Own library for sikuli


Machine 2:
1.Robot framework, jython 2.5.2, jybot
2. Test scripts (Eg: Notepad.robot)

STEPS:

1. Run the sikuli library using command "jython <sikulilibrary>"

It will start the Remote library for the interface configured in the library file and exposed keywords

2.  Now run the robot script from any network machines using command

"jybot <Notepad.robot>"


The testresults will be available in the local machine (i.e Machine2)

Tuesday, September 8, 2015

Robot framework: Remote library

How to use simple remote library in robot framework? (Only for Python)

Pre-requisities:
1. Robot framework should be installed
2. Pybot command should work fine.

STEP 1:
Install robot remote server using command.

pip install robotremoteserver

Refer: https://github.com/robotframework/PythonRemoteServer

STEP 2:
Create a file as mentioned in the above link


from robotremoteserver import RobotRemoteServer
from mylibrary import MyLibrary

RobotRemoteServer(MyLibrary())

Remotelib.py:

if __name__ == '__main__':
    import sys
    from robotremoteserver import RobotRemoteServer
    from Example import test

    RobotRemoteServer(test(), host='192.168.10.104', port=8270, allow_stop=False)

192.168.10.104 - Remote machine ip where remote library exists


Here i have created a sample Example library with class "test"

Example.py

#!/usr/bin/env python

class test(object):
    """ Sample doc"""

    def add(self,x,y):
        self.x = int(x)
        self.y = int(y)
        return str(self.x + self.y)

STEP 3:
Start the Remoteserver  - command python Remotelib.py



STEP 4:
Sample Robot script


*Settings*
Documentation               This is just a tutorial for Remote library

Library    Remote    http://192.168.10.104:8270

*** Test Cases ***
Check Remote library first keyword
    [Documentation]         Check ADD keyword of remote library
    ${ANS}=    Add    1    6
    Should Be Equal    ${ANS}    7



STEP 5:
Test execution: