running multithreaded test

2,085 views
Skip to first unread message

Ek

unread,
Jun 19, 2011, 9:03:38 AM6/19/11
to robotframework-users
Hi
I am trying to run a multi threaded test using robot-framework in
which I am new to, but I am facing the following issue:
When I raise exception inside my thread to indicate fail, this
exception is being reported as "INFO" in the log and not as FAIL,
resulting my test to report pass and not fail as its expected ?
my question is how can I do it correctly ? report FAIL from my
threads.
Is there an alternative way to report "FAIL" beside using "raise" ?
Best Regards
EK

Pekka Klärck

unread,
Jun 19, 2011, 4:31:28 PM6/19/11
to eyas....@gmail.com, robotframework-users
2011/6/19 Ek <eyas....@gmail.com>:

> Hi
> I am trying to run a multi threaded test using robot-framework in
> which I am new to,

Welcome aboard!

> but I am facing the following issue:
> When I raise exception inside my thread to indicate fail, this
> exception is being reported as "INFO" in the log and not as FAIL,
> resulting my test to report pass and not fail as its expected ?
> my question is how can I do it correctly ? report FAIL from my
> threads.

You should generally communicate with Robot only from the main thread.
Logging messages from threads ought to work, but exceptions should be
risen only from the main thread.

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Ek

unread,
Jun 20, 2011, 6:04:06 AM6/20/11
to robotframework-users
Hi peke
Thanks for the reply .

I understand that raising exception should be done only from main
thread,
but still is there is any way that I can report fail from thread ?
this is important for my testing, Is three is a Report API that I can
call it just to report FAIL ?
If not then how can I pass status from threads back to main thread, I
tried CallBack object but it also didn't work.

Regards
EK


On Jun 19, 11:31 pm, Pekka Klärck <p...@iki.fi> wrote:
> 2011/6/19 Ek <eyas.ko...@gmail.com>:
>
> > Hi
> > I am trying to run a multithreadedtest using robot-framework in

Taylor, Martin

unread,
Jun 20, 2011, 8:22:57 AM6/20/11
to eyas....@gmail.com, robotframework-users
Hi EK,

I'm not sure how exactly you're using threads in your RF test library, but we do it all the time at TI. In our design the main thread accepts a "run_keyword" call from RF and then distributes the work to each thread. Each thread is driving a different SUT (e.g. a different attached TI-Nspire device). The main thread then gathers the results from each of the worker threads. If ANY of the worker threads returns a "FAIL" then a "FAIL" exception is generated by the main thread. This exception would identify the number, and which, of the device-specific threads that had a failure.

Is this design anything like what you're doing with multiple threads in your RF test library?

Cheers,
Martin

Regards
EK

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To post to this group, send email to robotframe...@googlegroups.com.
To unsubscribe from this group, send email to robotframework-u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/robotframework-users?hl=en.

Ek

unread,
Jun 20, 2011, 8:51:04 AM6/20/11
to robotframework-users
OK I have just done this and would like to share how:
I collect the fails into a property of the thread object, without
raising exception.
At end - in the main thread - only when all threads are done, I check
in each thread object for an error message in the property -
if there is such one I raise and exception and thats how my test is
marked as failed, otherwise the test is passed since no thread has
failed.

Still it would would have been a great to have report API to just
report fail steps without raising exceptions.

Regards
EK

Mikko Korpela

unread,
Jun 20, 2011, 10:45:38 AM6/20/11
to cmta...@ti.com, eyas....@gmail.com, robotframework-users
Hi all,

@Martin: Your setup sounds interesting. Do the SUTs communicate with
each other? What do the tests look like?

One thing that I've been working on is a general network package
testing library[1] and any experience with tests that interact with
multiple communicating SUTs would be helpful.
Main question:
How to model in robot test data in an understandable and clean way the
situations where multiple actors/SUTs communicate with each other?

We have also done an experimental multiprocessing library that also
supports interprocess (between robots that can even run on different
machines) communication[2] .. but it is really very experimental.

[1] http://code.google.com/p/rammbock/
[2] http://code.google.com/p/robotframework/source/browse/proto/parallel

2011/6/20 Taylor, Martin <cmta...@ti.com>:

--
Mikko Korpela

Christian Rudolf Tan

unread,
Dec 14, 2014, 10:13:28 AM12/14/14
to robotframe...@googlegroups.com, cmta...@ti.com, eyas....@gmail.com
Hi to all!

I am new to robot framework and also new to python... so far I have learn to use robot with the selenium2library (http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html).

I was hope that anyone could share some reference on how to make a multi thread test. as of now not so much information I can find in the web except from this group. I hope someone could help me.


Cheers!
Christian

> To unsubscribe from this group, send email to robotframework-users+unsub...@googlegroups.com.


> For more options, visit this group at http://groups.google.com/group/robotframework-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "robotframework-users" group.
> To post to this group, send email to robotframe...@googlegroups.com.

> To unsubscribe from this group, send email to robotframework-users+unsub...@googlegroups.com.


> For more options, visit this group at http://groups.google.com/group/robotframework-users?hl=en.
>
>

--
Mikko Korpela

Reply all
Reply to author
Forward
0 new messages