Using a user environment , you can use the framework design of the robot. For example, here are the steps that I used to run a robotic design test in Device Farm.
git clone https://github.com/serhatbolsu/robotframework-appiumlibrary.git cd robotframework-appiumlibrary
Then I made changes to the resource file to run the device farm, referencing environment variables .
./demo/test_android_contact_resource.txt
*** Settings *** Library AppiumLibrary *** Variables *** ${REMOTE_URL} http://localhost:4723/wd/hub ${PLATFORM_NAME} %{DEVICEFARM_DEVICE_PLATFORM_NAME} ${DEVICE_NAME} %{DEVICEFARM_DEVICE_NAME} ${APP} %{DEVICEFARM_APP_PATH} *** Keywords *** add new contact [Arguments] ${contact_name} ${contact_phone} ${contact_email} Open Application ${REMOTE_URL} platformName=${PLATFORM_NAME} deviceName=${DEVICE_NAME} app=${APP} automationName=UIAutomator2 Click Element accessibility_id=Add Contact Input Text id=com.example.android.contactmanager:id/contactNameEditText ${contact_name} Input Text id=com.example.android.contactmanager:id/contactPhoneEditText ${contact_phone} Input Text id=com.example.android.contactmanager:id/contactEmailEditText ${contact_email} Click Element accessibility_id=Save
Then I created a test package to upload to Device Farm by doing the following:
Next, I used the following command in the testspec.yml file to run tests in Device Farm.
bin/robot --outputdir $DEVICEFARM_LOG_DIR/robotresults tests/test_android_contacts.txt
source share