3

I couldn't find a way how to disable video recording when using selenium.

Using CLI one can do so as mentioned in this comment:

aws devicefarm schedule-run \
    --project-arn YourProjectArn \
    --app-arn YourApplicationArn \
    --device-pool-arn YourDevicePoolArn \
    --name MyTestRun \
    --test '{"type": "CALABASH","testPackageArn":"YourTestPackageArn","parameters": {"video_recording": "false"}}'

But I'd like to do so using python & selenium. Sample code:

from boto3 import client
from selenium import webdriver


def main():
    device_farm_client = client("devicefarm", region_name='us-west-2')

    test_grid_url_response = device_farm_client.create_test_grid_url(
        expiresInSeconds=666,
        projectArn="arn:aws:devicefarm:us-west-2:..."
    )

    driver = webdriver.Remote(
        command_executor=test_grid_url_response['url'],
        desired_capabilities=webdriver.DesiredCapabilities.CHROME,
    )

    driver.get('https://api.ipify.org')
    print(f"Your IP is: {driver.find_element_by_tag_name('pre').text}")

    driver.quit()


if __name__ == '__main__':
    main()

How do I update the code to disable the video recording?

Ikar Pohorský
  • 4,617
  • 6
  • 39
  • 56
  • 1
    Currently, based on AWS Device Farm's [documentation](https://docs.aws.amazon.com/devicefarm/latest/testgrid/techref-support.html), you cannot disable the video recording for desktop Selenium tests – Tobe E Feb 29 '20 at 00:22
  • @TobeE I don't see any mention about video recording in the doc you linked. But yeah it seems like the possibility is just missing. – Ikar Pohorský Mar 02 '20 at 07:43
  • @IkarPohorský Is there a reason you would like the video recording to be disabled ? Taking a guess here, are you concerned about performance ? – NikofTime Apr 24 '20 at 03:40
  • @NikofTime that's correct. This question is a followup on this one: https://stackoverflow.com/questions/60430453 I just had to give up on AWS Device Farm and built a custom autoscaled selenium farm... – Ikar Pohorský Apr 25 '20 at 03:59
  • 1
    @IkarPohorský i replied to this question stackoverflow.com/questions/60430453 – geek2geek_AWS Apr 25 '20 at 18:27
  • @geek2geek_AWS thank you, though it still doesn't solve the problem :( – Ikar Pohorský Apr 26 '20 at 09:54

0 Answers0