Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Nov 04, 2020 11:50

Robot Framework is a generic open-source automation framework that you can use for test automation and robotic process automation (RPA). The framework is open and extensible and integrates with almost any other tool to create powerful and flexible automation solutions. Being open source also means that Robot Framework is free to use without licensing costs.

Because Robot Framework requires less technical skill than frameworks based on a programming language, even team members with very little programming experience can use it. For example, an agile team product owner could express acceptance tests using the framework without having to know the details of how the product is implemented. At the same time, because of the framework's keyword-based design, those with advanced technical skills can write keywords in their language of choice to test low-level functions perform unit and integration testing.

This section walks you through integrating Robot Framework with Perfecto.

Prerequisites

Integrating Perfecto with Robotframework requires the following PyPi packages.

Package nameVersion
robotframework2.6.0 or later
Appium-Python-Client0.20 or later
selenium2.47.1 or later
robotframework-appiumlibrary1.3.7 or later
robotframework-seleniumlibrary3.0.0 or later
robotframework-selenium2library1.6.0 or later
six1.11.0 or later

On this page:


1 | Integrate with SeleniumLibrary

When running tests against browsers on desktop or mobile devices, you can use the Robot Framework SeleniumLibrary.

To integrate with SeleniumLibrary:

  1. For browsers, use any of the following keywords to launch the session: Open Browser or Create Webdriver 
  2. Provide the Perfecto remote WebDriver URL along with a set of capabilities, in dictionary format.

  3. When the driver launches, interact with Perfecto browsers by using all regular SeleniumLibrary keywords the same way you use them with local browsers.

Launch the Perfecto WebDriver
*** Variables ***
${Perfecto_Webdriver_Url}     https://Your_Cloud_Name.perfectomobile.com/nexperience/perfectomobile/wd/hub/fast
${Security_Token}        Your_Perfecto_Security_Token
*** Test Cases ***
# Sample with Open Browser: 
${caps}=   create dictionary    browserName=Safari       platformName=iOS           location=NA-CA-YYZ              manufacturer=Apple        model=iPhone-X         securityToken=${Security_Token}
Open Browser    https://www.perfecto.io     browser_name    alias    ${Perfecto_Webdriver_Url}  ${caps}

# Sample with Create Webdriver:
${caps}=   create dictionary    browserName=Safari       platformName=iOS           location=NA-CA-YYZ              manufacturer=Apple        model=iPhone-X         securityToken=${Security_Token}
Create Webdriver    Remote   command_executor=${Perfecto_Webdriver_Url}    desired_capabilities=${caps}

2 | Integrate with AppiumLibrary

When running tests against native apps on mobile devices, you can use the Robotframework AppiumLibrary.

To integrate with AppiumLibrary:

  1. To open an Appium session with Perfecto mobile devices, use the keyword Open Application
  2. Provide the Perfecto remote WebDriver URL along with a set of capabilities.

  3. After the driver launches, interact with Perfecto mobile devices by using all regular AppiumLibrary keywords the same way you use them with local devices.

Launch the Perfecto Appium session
*** Variables ***
${Perfecto_Webdriver_Url}     https://Your_Cloud_Name.perfectomobile.com/nexperience/perfectomobile/wd/hub/fast
${Security_Token}        Your_Perfecto_Security_Token
${Device_Id}             Perfecto_Device_Id_you_want_to_launch
${Bundle_Id}             The_IOS_Bundle_Id_you_want_to_launch # this is option, session will launch a default browser of the OS without this capability
*** Test Cases ***
Open Application    ${Perfecto_Webdriver_Url}    securityToken=${Security_Token}    deviceName=${Device_Id}      noReset=True   bundleId=${bundleId}

3 | Integrate with Perfecto Smart Reporting

For details, see Integrate Perfecto Smart reporting with Robot Framework.