UI Test Automation Framework Flashcards

1
Q

What is POM?

A

A page object or a page class is basically a representation of all or some of the actions and operations which can be performed on that page of your application. POM (Page Object Model) is a design pattern that is used in selenium test automation for organizing the helper code for maintainability and reducing code duplication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is LoadableComponent?

A
LoadableComponent is a base class that aims to ensure:
    Pages are loaded.
    The initial state of the page is asserted.
    The elements are intractable before we use them.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

WebDriver Manager

A

create our web driver objects in a way that it can handle parallel runs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

BaseTest

A

super class for all test classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

locators file

A

Locators file could be of any format, such as .properties, .xml, .json, .yaml, .ini, .toml. For demonstration purposes, .properties is considered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Need for DataManager

A

Oftentimes, we will be using some static test data that is specific to an environment. The environment could be staging, production, development, etc For maintaining the environment, we can have a separate class for managing that.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Sample page objects

A

when creating instances of the pages, we need to call get() to take advantage of the LoadableComponent feature.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Abstract Base Test class

A

Abstract base test class will be a superclass for all test files; it will have driver initialization, navigating to launch Urls and will have common functionalities used across the test classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Best practices for automation

A

No hardcoding of test data in a test class.
Add logs for important steps.
Lots of meaningful assertions should be added.
No hard coding of configurations.
Page operations should be part of the page object class.
Helpers for DB, files, etc., should be part of utility class.
Add proper test comments.
Give meaningful names to the test methods and follow java naming conventions.
Group tests (such as sanity, regression, P0, etc.).
Avoid dependent tests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Building a gradle project#

A

gradle clean build -x test

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Tests for allure steps and attaching screenshots on failure:

A

gradle clean test –tests “com.educative.test.TestGoogleSearch” -Dbrowser=chrome

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Overriding configuration from command line

A

gradle test -Dbrowser=firefox

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Generated report paths

A

TestNG - ./test-output/index.html
Allure - ./build/reports/allure-report/index.html
Gradle - ./build/reports/tests/test/index.html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

./gradlew clean build -x test

A

Generating the test Framework Jar. The project will be cleaned, compiled and the distribution jar will be created along with Javadoc and sources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Uploading the test Framework Jar

A

./gradlew uploadArchives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Distribution of Test Framework Library

A

Create the framework jar using any build management tool (Maven or Gradle).
Upload the binary to the Artifactory (hosted locally or remotely).
Create a Java test project and download the binary as a dependency for writing and executing tests.
Setup Jenkins or any CI tool.
Create a job for running tests via CI tool.
Reports will be shared to stakeholders.

17
Q

Artifactory

A

used for hosting the framework jar or library

18
Q

Code Repository

A

repository to host the framework code and test project code ( GitHub, BitBucket, etc.)