Robot Framework Included with SikuliX 1.1.4 Does Not Embed Take Screenshot Image in Log.html

Asked 2 years ago, Updated 2 years ago, 62 views

Overview

I use the Robot Framework bundled with Sikulix.

If you write down the Take Screenshot keyword in the test case (.robot),


with test results in Log.html The screen image should be embedded, but
I'm in trouble because it's not embedded.

Similar incidents are also present at related sites, and actions are being taken.
When I put in the debug code, it seems that the cause is different.
I'm at a loss how to get embedded.

If anyone knows the cause or action, please let me know.

environment

  • Windows 7 Enterprise 64bit
  • SikuliX1.1.4
  • Robot Framework (bundled with SikuliX 1.1.4)
  • Python 2.7.1 (bundled to SikuriX 1.1.4)
  • SikulixIDE 1.1.4

what someone did

  • Source Code

Robot_Run_01.sikuli/sample.robot (robot script)
`RobotFramework

***Variables***

*** Settings***
Library Operating System
Library TestLib.sikuli/TestLib.py
LibraryScreenshot${OUTPUTDIR} width=640px

*** Test Cases***
Test Case 1
Take a screenshot ${TEST NAME}_Before
display a calculator
Take a screenshot ${TEST NAME}_After



*** Keywords***
display a calculator
open_calc

Take a screenshot ${NAME}
TakeScreenshot${NAME}

TestLib.sikuli/Testlib.py (simple Sikuli script to wait for the computer to start)

#coding:utf-8
from sikuli import*
# from__future__import with_statement

class TestLib (object):
    default_calc(self):
        self.calc=App.open("calc")
        wait("1536568964767.png", 1)

```

Robot_Run_01.sikuli/Robot_Run_01.py (script to launch Robot).Run from SikulixIDE)

 from threading import currentThread

prepareRobot()
workdir=getBundleFolder()

testdata="sample.robot"

datasource=os.path.join(workdir, testdata)

# To address the issue where no images are embedded in Log.html
# Explicitly specify Thead name by referring to the site below ➡ Not resolved
# https://groups.google.com/forum/#!topic/rfw-users-jp/Z3YaEGgz3Wk
# # https://answers.launchpad.net/sikuli/+question/294598
currentThread().name = 'MainThread'

robot.run (datasource, outputdir=workdir)
  • Run Results
    (***SikulixIDE)
    ![Image Description] (d6211972ecf64a3c94f4a05c10607d6a.png)
    (*Log.html
    ) Images should be embedded but not
    ![**Log.html**](e78e00646666f7bad250fb62b6d2f6c4.png)

what someone did

(***librarylogger.py)
![Image Description] (6aa5db9b211a8212c340662a3e31379e.png)
Output.xml says "MainThread" as expected (link to image is embedded...)
(
output.xml**)
![Image Description](176d86adcc2e2ab07a0ae16351f9e50.png)

python rpa sikulix

2022-09-30 19:22

1 Answers

I don't know why, but now I can do what I want by replacing the Robot Framework 3.0 that came with Sikurix 1.1.4 with the latest 3.0.4.

Specifically
C:\Users\Username\AppData\Roaming\Sikulix\Lib\robot
Replacing everything in resolved the problem.


2022-09-30 19:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.