Can I automate test over 2 platforms?

I usually do automate on Andorid.
But sometimes, I need to do something on web(Windows, Mac, whatever) first.
Can I automate over PC and android in 1 RF?
OR can I do that in 2 RF in order?
Plz Help…

I once had the idea of using 1 suite for 2 different workflows. My plan was to export all keywords in a remote library and replace this remote library depending on the workflow I want to launch.

But I never tried.

You can use RemoteLibraries with RobotFramework, so that you can connect a library running on another machine to you robot.

So robot can run on Windows and a few keywords are executed on a Mac.

Yes you can. Let’s assume you have an application which runs on Android and on Web so that the end-user workflows are pretty much the same on both platforms. For example some note-taking application which has both Web and Android interfaces.

You could, and should anyway, write your tests in such a way that the test cases itself do not contain anything platform specific, but only describe the end-user workflows. Like this:

Create new note
    [Setup]    Log in with valid credentials
    Start creating new note
    Set note content    Lorem ipsum dolor sit amet
    Save note
    Verify note is saved    Lorem ipsum dolor sit amet

Then you implement all those keywords in two different resources; Android resource and Web resource. Android using (usually) AppiumLibrary and Web using (usually) SeleniumLibrary and import the proper resource at runtime. Like this:

*** Settings ***
Resource    ${PLATFORM}-resource.robot

*** Variables ***
${PLATFORM}    Android

and specify the wanted platform in robot command;

robot --variable PLATFORM:Web test.robot

A bit nicer way of implemeting this whould be to have just one python lib which takes the platform as an argument and then imports proper libs, but that is a bit more complex to demonstrate.

2 Likes