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.
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)
(***librarylogger.py)
Output.xml says "MainThread" as expected (link to image is embedded...)
(output.xml**)
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.
© 2024 OneMinuteCode. All rights reserved.