After the execution the reports are not generating properly
reports and log link
Here is the python code for threading
import threading
from robot.libraries.BuiltIn import BuiltIn
thread_list =
class thread_that_runs_kw(threading.Thread):
def init(self, name, kwname, *args):
threading.Thread.init(self)
self.name = name
self.kw = kwname
self.args = args
self.result = None
def run(self):
print("starting thread: %s" % self.name)
self.result = BuiltIn().run_keyword(self.kw, *self.args)
def run(self):
print("starting thread: %s" % self.name)
self.result = BuiltIn().run_keyword(self.kw, *self.args)
def wait_for_threads():
return_dict = {}
for thread_obj in thread_list:
thread_obj.join()
return_dict[thread_obj.name] = thread_obj.result
return return_dict
def run_kw_in_thread(thread_id, kw, *args):
t = thread_that_runs_kw(thread_id, kw, *args)
thread_list.append(t)
t.start()
Robot test file
*** Settings ***
Library threads.py
*** Test Cases ***
Run multiple threads
run kw in thread thread-1 keyword1
run kw in thread thread-2 keyword2
${k}= wait for threads
log to console harsha
Log to console ${k}
*** Keywords ***
Keyword1
log to console 11
sleep 8
log to console 15
[Return] 20 30
Keyword2
log to console ka
sleep 5
[Return] 10