You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run robot with multi thread has error: [ ERROR ] Reading XML source 'D:\result\output.xml' failed: Incompatible child element 'statistics' for 'kw'.
#5026
Open
ysy1418899560 opened this issue
Jan 18, 2024
· 1 comment
hello, when I run robot with multi thread has error: [ ERROR ] Reading XML source 'D:\result\output.xml' failed: Incompatible child element 'statistics' for 'kw'.
I start 4 threads to execute run(robot_file_path, outputdir=result_path) at the same time, i get a error message: [ ERROR ] Reading XML source 'D:\result\output.xml' failed: Incompatible child element 'statistics' for 'kw'.
below is my code script:
import threading
from robot import run
class MultiThreadings(object):
def __init__(self):
self.thread = threading
def run(self, robot_file_path, result_path):
run(robot_file_path, outputdir=result_path)
threading_id_str = "thread" + str(self.thread.get_ident())
def multi(self, robot_file_path, result_path):
threads = []
for i in range(0, 4):
t = self.thread.Thread(target=self.run, args=(robot_file_path, result_path + "-" + str(i)))
threads.append(t)
for t in threads:
t.start()
I've had the same problem many times. The robot.api.logger is not thread-safe, you should not call it from different threads, only the MainThread. I'm considering creating a monkeypatch to add a mutex over it.
robotframework: 6.1.1
python: 3.7.9
hello, when I run robot with multi thread has error: [ ERROR ] Reading XML source 'D:\result\output.xml' failed: Incompatible child element 'statistics' for 'kw'.
I start 4 threads to execute run(robot_file_path, outputdir=result_path) at the same time, i get a error message: [ ERROR ] Reading XML source 'D:\result\output.xml' failed: Incompatible child element 'statistics' for 'kw'.
below is my code script:
import threading
from robot import run
class MultiThreadings(object):
robot_file_path = "./01.robot"
result_path = "./result"
multi = MultiThreadings()
multi.multi(robot_file_path, result_path)
print("ok")
The text was updated successfully, but these errors were encountered: