Try   HackMD

Using SideeX in Robot Framework

Prerequisite

Step 1 - Create a SideeX library for Robot Framework

Create an empty file SideeXLibrary.py, and paste the following content. You can modify the path of ./sideex-runner.js to where you save the SideeX Runner.

import subprocess
from robot.api import logger
class SideeXLibrary:
    def sideex_run_with(self,config):
        p = subprocess.Popen(['node', './sideex-runner.js' ,'-c', config],text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        while True:
            line = p.stdout.readline()
            if not line:
                break
            if line[:5]=="ERROR":
                if line=="ERROR Test case failed":
                    raise Exception(line)
                else:
                    logger.error(line)
            elif line[:4]=="INFO":
                logger.info(line)
            else:
                logger.debug(line)

Step 2 - Use SideeX Runner through the library

First, include ./SideeXLibrary.py as a library and ./sideex-config.json as a variable. Second, add Sideex Run With ${CONFIG} in a test case.

*** Settings ***
Documentation     A test suite run with sideex.
Library           ./SideeXLibrary.py

*** Variables ***
${CONFIG}         ./sideex-config.json

*** Test Cases ***
Test Run
    Sideex Run With  ${CONFIG}

Step 3 - Run the Robot Framework test case

Open the terminal and run robot your_Robot_Framework_test_case. The SideeX-recorded test cases defined in sideex-config.json will be run. The SideeX test result will be included in the Robot Framework result.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →