Home > Blockchain >  Robot framework - How to create script with appium library and selenium library and run on both mobi
Robot framework - How to create script with appium library and selenium library and run on both mobi

Time:03-01

I've created a simple test for a native iOS application by using appium library (robot framework), but in the same test I want to compare data from the mobile application with data in a web application via desktop browser on Mac, not a mobile browser. (For E.g.: To check if the username saved in the mobile app has been successfully displayed on the web app.)

Is it possible to perform this in a single test i.e. by using robot framework appiumlibrary and selenium library together?

I tried to import the Selenium library and use a keyword from it, but it wasn't recognized - 'No keyword with name 'Open Browser' found.'.

*** Settings ***
Library  AppiumLibrary
Library  SeleniumLibrary

*** Test Cases ***

Open the iOS app and create new user
    Open Application  *My app*
    Step 1
    Step 2
    .
    .
    .
Open url in desktop browser
    Open Browser  ${URL}  googlechrome

CodePudding user response:

When using AppiumLibrary and SeleniumLibrary we must prefix keywords with the library name, because some keywords have the same names. In your case, if the test cases are clearly separated in terms of libraries context, you can change the code to:

*** Settings ***
Library  AppiumLibrary
Library  SeleniumLibrary

*** Test Cases ***

Open the iOS app and create new user
    Open Application  *My app*
    Step 1
    Step 2
    .
    .
    .
Open url in desktop browser
    SeleniumLibrary.Open Browser  ${URL}  googlechrome

Other option is to import the library, only on the test you need:

*** Settings ***
Library  AppiumLibrary

*** Test Cases ***

Open the iOS app and create new user
    Open Application  *My app*
    Step 1
    Step 2
    .
    .
    .
Open url in desktop browser
    Import Library  SeleniumLibrary
    Open Browser  ${URL}  googlechrome
  • Related