AWS DevOps Robot Programming & Configuration 5 — Questions and Answers
Question 1: In Robot Framework, which file extension is used for resource files that contain reusable keywords and variables shared across multiple test suites?
- .resource (Correct answer)
- .robot
- .py
- .yaml
Correct answer: .resource
Robot Framework 4+ recommends the `.resource` extension for files containing only reusable keywords and variables, not test cases.
Question 2: When a Robot Framework test suite in CodeBuild needs to test an application running in a Docker container, what is the recommended approach in buildspec.yml?
- Start the Docker container in pre_build and run robot tests in build phase pointing to localhost (Correct answer)
- Use CodeDeploy to deploy the container before the test
- Push the container to ECR and test from a separate pipeline stage
- Use AWS Fargate to launch the container during the CodeBuild run
Correct answer: Start the Docker container in pre_build and run robot tests in build phase pointing to localhost
Starting the container in pre_build and targeting localhost in robot tests is the standard pattern since CodeBuild supports Docker-in-Docker by default.
Question 3: Which Robot Framework listener interface method is called after each individual test case completes, making it useful for real-time reporting to AWS CloudWatch?
- end_test (Correct answer)
- close
- log_message
- start_suite
Correct answer: end_test
The `end_test` listener method receives test name and status after each test, allowing custom actions like pushing metrics to CloudWatch.
Question 4: A team wants to parallelize Robot Framework tests across multiple CodeBuild instances. Which approach is MOST cost-effective for splitting test execution?
- Use CodeBuild batch builds with matrix strategy to run test subsets in parallel (Correct answer)
- Launch multiple CodePipeline pipelines simultaneously
- Use AWS Step Functions to orchestrate sequential CodeBuild jobs
- Manually partition tests into separate CodeCommit repositories
Correct answer: Use CodeBuild batch builds with matrix strategy to run test subsets in parallel
CodeBuild batch builds with matrix configurations allow parallel test execution on separate instances with automatic result aggregation in a single build.
Question 5: In Robot Framework, what is the purpose of the `[Teardown]` setting within a test case?
- Execute cleanup actions after the test regardless of pass or fail outcome (Correct answer)
- Initialize test prerequisites before the test starts
- Mark the test case for exclusion from reports
- Define the expected failure message for the test
Correct answer: Execute cleanup actions after the test regardless of pass or fail outcome
`[Teardown]` always runs after a test case completes, even if the test fails, ensuring cleanup like closing browsers or deleting test data.
Question 6: Which AWS CodeBuild report group feature allows you to track Robot Framework test trends over multiple builds?
- Test reports with output.xml parsed as JUnit XML format (Correct answer)
- CloudWatch dashboards with build duration metrics
- S3 bucket versioning on the artifact folder
- CodeCommit commit history annotations
Correct answer: Test reports with output.xml parsed as JUnit XML format
CodeBuild report groups support JUnit XML format; Robot Framework's output can be converted or exported as JUnit XML, enabling trend tracking across builds.
Question 7: When configuring Robot Framework to run against an application deployed to multiple AWS regions, what is the BEST practice for parameterizing the target endpoint URL?
- Pass the URL as a Robot Framework variable via --variable flag set from a CodeBuild environment variable (Correct answer)
- Hardcode all regional URLs in the .robot test file with conditional logic
- Use a separate .robot file per region with URLs embedded
- Store URLs in a DynamoDB table and query them inside the test cases
Correct answer: Pass the URL as a Robot Framework variable via --variable flag set from a CodeBuild environment variable
Passing `--variable BASE_URL:${TARGET_URL}` at runtime allows the same robot test suite to target different regional endpoints controlled by CodeBuild environment variables.
In Robot Framework, which file extension is used for resource files that contain reusable keywords and variables shared across multiple test suites?