- Más nuevo
- Más votos
- Más comentarios
When running Appium tests in AWS Device Farm, you can change device orientation programmatically within your Appium Robot Framework tests rather than through Device Farm configuration.
For both iOS and Android devices, you can use Appium's capabilities to control device orientation by adding commands in your test script. Here's how you can implement this in your Robot Framework tests:
*** Keywords ***
Set Device Orientation To Landscape
Execute Driver Script driver.orientation = "LANDSCAPE"
Set Device Orientation To Portrait
Execute Driver Script driver.orientation = "PORTRAIT"
You can also fine-tune your Appium server parameters in Device Farm by adjusting the default Appium capabilities in your test spec file. For example, you could include orientation-related capabilities in your pre_test phase:
phases:
pre_test:
- # Start up Appium with custom capabilities
- >-
appium --log-timestamp
--default-capabilities "{\"deviceName\": \"$DEVICEFARM_DEVICE_NAME\",
\"platformName\":\"$DEVICEFARM_DEVICE_PLATFORM_NAME\",
\"app\":\"$DEVICEFARM_APP_PATH\",
\"automationName\":\"XCUITest\",
\"udid\":\"$DEVICEFARM_DEVICE_UDID_FOR_APPIUM\",
\"platformVersion\":\"$DEVICEFARM_DEVICE_OS_VERSION\"}"
>> $DEVICEFARM_LOG_DIR/appiumlog.txt 2>&1 &
Remember that while the remote access interface provides UI controls for changing orientation, for automated tests you need to implement the orientation changes directly in your test code using Appium commands.
Sources
Speeding up Appium-based tests in Device Farm through desired capabilities - AWS Device Farm
Extending custom test environments in Device Farm - AWS Device Farm
Contenido relevante
- preguntada hace un mes
- preguntada hace 7 meses
- preguntada hace 4 meses
- preguntada hace un mes
- OFICIAL DE AWSActualizada hace 4 años

Getting error 'No keyword with name 'Execute Driver Script' found.', is the above solution correct