1
votes

I have some problem running Robot Framework test suite with appium and pabot.

I'm running some tests suite on multiple android devices like this:

pabot --pabotlib --argumentfile1 phone1.dat --argumentfile2 phone2.dat -v LANG:fr --outputdir output --output basics.xml JustBasics_tests.robot 
pabot --pabotlib --argumentfile1 phone1.dat --argumentfile2 phone2.dat -v LANG:fr --outputdir output --output another.xml LetsRunAnother_test.robot 

I don't execute all suites in a single pabot instruction because I got some appium errors if I do like this ... errors like: WebDriverException: Message: A session is either terminated or not started pabot or WebDriverException: Message: A new session could not be created. Details: Problem getting session data for driver type AndroidDriver; does it implement 'get driverData'?

I want to make a report from another.xml and basics.xml to something like log.html and report.html (to work with Jenkins after).

My first problem is that basics.xml and another.xml files contain only one test execution from one of the two devices. If I want data from both devices of a test case execution I need to take the output.xml file which contains both test case execution... Of course output.xml is overwritten after each pabot command.

So I thought to just copy each output.xml and rename to outputX.xml and finally make a

rebot output1.xml output2.xml output3.xml .... 

But rebot doesn't work like I expected : rebot just copying X times the first mobile test on the report so I have something like on my log.html:

JustBasics
Test_Results_for_phone1
Test_Results_for_phone1

LetsRunAnother
Test_Results_for_phone1
Test_Results_for_phone1

What am I doing wrong?

My second problem is that there are no screenshots in my log files, when something fails in test execution (error or crash of app for exemple). They all point to root directory from the log.html but images are in a path like pabots_results/X/TestSuiteName/appium-screenshoot-x.png Here again what is wrong? Do I have to do something about images, or pabot should do it alone (in pabot.py nearly then end of file, there is a function named _copy_screenshots ....)

The disturbing thing about this story is that there are not plenty of documentation about pabot. And I don't know if I'm doing something wrong or if pabot has some bugs!

So thanks for reading me, and see you ;)!

UPDATE : To avoid all these problems, I wrote this little tool : https://github.com/bastienjalbert/aptr

2
Thank you for your advice. I'll try to do like you told me the next times - bastien enjalbert
I made this little tool to solve my problem github.com/bastienjalbert/aptr - bastien enjalbert

2 Answers

1
votes

For your screenshots issue, I'm assuming you're using Jenkins' Robot Framework plugin. What happens here is, that on post-execution of your tests, the plugin will move your output, report and log to the current build's workspace, to display it in the build's dashboard. The screenshots on the other hand, are by default, not moved.

In your job configuration, under post-build actions, you should have publish Robot Framework test results. Click the advanced button, to see all options, and you should have a field labeled as other files to copy

In this field you add the path that matches your selenium screenshots (probably just *.png)

Now, after your test execution, the plugin should move your screenshots in the same location as your log.html and they will be able to display in the log.

You can actually find this, and more information that may be relevant to you, in the plugin's page

0
votes

I think you will want to use

rebot --merge output1.xml output2.xml output3.xml .... 

From

rebot --help

(...)
Options
=======

 -R --merge               When combining results, merge outputs together
                          instead of putting them under a new top level suite.
                          Example: rebot --merge orig.xml rerun.xml
(...)