1. Home
  2. Opkey Help
  3. 25. Opkey Keyword Documentation
  4. 25.6 Web Keywords

25.6 Web Keywords

AccessibilityCheckPointsSettings

Accessibility Testing is a subset of Usability Testing and it is performed to ensure that the application being tested is usable by people with disabilities like hearing, color blindness, old age and other disadvantaged groups.

This keyword sets the prerequisites for Accessibility Test. It takes the report name of the Accessibility Test and the location where the Accessibility Report of a page after creation will be stored.

It will check the Accessibility of the current page and will generate the Accessibility Report of that particular page at the location or path given by the user.

Input Arguments

Object Input Arguments

Required?

Description

Object

No

This keyword does not require any Object input argument.

 

Data Input Arguments

Required?

Description

Report

Name

Yes

* It is of String type.

* It takes the name of the report to be created.

Report FolderPath  

Yes

* It is of String type.

* It takes the path(location) where Accessibility Report will be saved after creation.

Output

 

True

If the keyword passes successfully

False

If the Keyword Fails

Example

Suppose you want to sets the prerequisites for Accessibility Test then, here is how you will use AccessibilityCheckPointsSettings keyword.

AccessibilityCheckPointsSettings

Report Name

ABC

Report Folder Path

Common Error conditions

Scenarios

Error Message

Debug Information

If Data Input Argument is not given

Argument Data Missing

Argumnent(s): (ReprtName; ReportFolderPath) is/are blank.

SetViewPort

This keyword sets the Page Layout according to the given dimensions. It is basically used to open any website/browser in the Mobile View.

Input Arguments

Object Input Arguments

Required?

Description

Object

No

This keyword doesn’t take any object input argument.

 

Data Input Arguments

Required?

Description

Width

Yes

* It is of Integer type.

* It takes the width of the page.

Height Yes

* It is of Integer type.

* It takes the height of the page.

Output

 

True

If the keyword passes successfully

False

If the Keyword fails

Example

Suppose you want to set the Page Layout according to the given dimensions, then you can use SetViewPort keyword as follows:

SetViewPort

Width

412

Height

732

Browser with Width “412” & Height “732”

s14.png

Common Error conditions

Scenarios

Error Message

Debug Information

If Data Input Argument is not given

Argument Data Missing

Argument(s): (Width;Height) is/are blank.

ValidatePageAccessibility

This keyword validates the Page Accessibility at run time and will generate an Accessibility Report which contains the required page Accessibility.

Input Arguments

Object Input Arguments

Required?

Description

Object

No

This keyword does not require any Object input argument.

 

Data Input Arguments

Required?

Description

Data

No

This keyword does not require any Data Input argument.

Output

 

True

If the keyword passes successfully

False

If the Keyword Fails

SampleAccessibilityReport

s12.png

Common Error conditions

There are no error conditions for this keyword.

VisualCheckPointsForObjects

This keyword takes the objects and test the location of the objects relatively to each other on a page. This keyword creates and compare different layout among different objects.

This keyword will take minimum of 10 objects.

Input Arguments

Object Input Arguments

Required?

Description

Object

(1-10)

Yes

This keyword requires an Object as an object input argument.

Note: You can Provide 10 Objects at a time with this keyword

 

Data Input Arguments

Required?

Description

SpecFile

Name

Yes

* It is of String type.

* It takes the name of the Spec (Objects) file.

* It is created once.

SpecFolder

Path

 

Yes

* It is of String type.

*It takes the path(location) where SpecFile will be saved after creation.

Output

 

True

If the keyword passes successfully

False

If the Keyword Fails

Example

Suppose you want to takes the objects and test the location of the objects relatively to each other on a page then, here is how you will use VisualCheckPointsForObjects keyword.

VisualCheckPointsForObjects

SpecFile Name

LIFE

SpecFolder Path

You can find the Values of the Data Input Arguments as follows: 

SpecName

S3.png

SpecFolderPath

s6.png

SampleVisualQAReport

S9.png

s10.png

Common Error conditions

Scenarios

Error Message

Debug Information

If no object is provided

Argument Data Missing

Data not provided for argument:’Object1; Object2; Object3; Object4; Object5; Object6; Object7; Object8; Object9; Object10′. Expected StaticValue was empty

VisualCheckPointsForPage

VisualCheckPointForPage keyword is basically used to compare a page with the already captured same page at runtime.

This keyword compares the page image by breaking image into given numbers of rows and columns.

This keyword when run for the first time will capture the current page snapshot and then the snapshot  will be compared with the same page when it will run for the second time. If there will be any differences, it will highlight the area of differences.

Input Arguments

Object Input Arguments

Required?

Description

Object

No

This keyword doesn’t take any object input argument.

 

Data Input Arguments

Required?

Description

Image

Name

Yes

* It is of String type.

* It takes the name of the image to be captured.

Should

Overlay

 

Yes

* It is of Boolean type.

* By default it is False.

* If it is False, it will highlight the image with Red dotted lines.

* If it is True, it will highlight the image with Green overlay.

Number

OfRows

 

Yes

 

* It is of Integer type.

* It is the number of rows in which image will be divided.

* By default, number of rows are 10.

 

 

NumberOf

Columns

 

 

Yes

* It is of Boolean type.

* By default it is False.

* If it is False, it will create the Spec(Objects) File.

* If it is True, it will compare the Specs(Objects) and will create a Visual QA Report.

Output

True

If the keyword passes successfully

False

If the Keyword Fails

Example

Suppose you want to compare a page with the already captured same page at runtime then, here is how you will use VisualCheckPointForPage keyword.

VisualCheckPointForPage

Image

Name

XYZ

Should

Overlay

False

Number

OfRows

20
NumberOf

Columns

20

Common Error conditions

There are no error conditions for this keyword.

VisualCheckPointSetting

This keyword sets prerequisites for the Visual QA. It takes the required settings need to perform the Visual QA on responsive websites.

Input Arguments

Object Input Arguments

Required?

Description

Object

No

This keyword doesn’t take any object input argument.

 

Data Input Arguments

Required?

Description

SpecFile

Name

Yes

* It is of String type.

* It takes the name of the Spec (Objects) file.

* It is created once.

SpecFolder

Path

 

Yes

* It is of String type.

*It takes the path(location) where SpecFile will be saved after creation.

Platform

 

Yes

 

* It is of String type.

* It takes the view(platform) on which a particular script has to be executed.

* Platform can be Mobile View or Desktop View.

 

 

Validate

Baseline

 

 

Yes

* It is of Boolean type.

* By default it is False.

* If it is False, it will create the Spec(Objects) File.

* If it is True, it will compare the Specs(Objects) and will create a Visual QA Report.

Approximation Range Yes

* It is of Integer type.

* It takes the approximate value upto which errors can be ignored.

Output

 

True

If the keyword passes successfully

False

If the Keyword Fails

Example

Suppose you want to sets prerequisites for the Visual QA then, here is how you will use VisualCheckPointSetting keyword.

VisualCheckPointSetting

SpecFile Name

ABC

SpecFolder Path

Platform Desktop
ValidateBaseline False
Approximation Range 10

You can find the Values of the Data Input Arguments as follows: 

S2.png

S3.png

Common Error conditions

Scenarios

Error Message

Debug Information

If Data Input Argument is not given

Argument Data Missing

Argument(s): (SpecFileName;

Platform;

SpecFolderPath; ValidateBaseline; Approximation

Range) is/are blank

LoadSeleniumJS

This keyword is used to load the OpKey Selenium-JS plugin at runtime which is to be used for the Test Execution. This keyword is generally used when you have a Test Case which has all Generic keywords along with few Selenium-JS keywords which are Selenium-JS specific. This keyword is doesn’t take any object or data input argument.

Scenario:

Suppose there is a Test Case which has both mobile & web test steps. In such case, you need to load both plugins (OpKey Mobility & Selenium-JS plugins) at runtime so that they can be used for executing respective test steps, as required.

You need to add this keyword (LoadSeleniumJS) with a test step, just before stating the Web flows. Save the test case and then click on Run Now. It will take few moments to load the required plugins (as per the added test steps). There will be a popup message regarding the loaded plugins which will be used for executing the test case.

Input Arguments

Object Input Arguments

Required?

Object

no

Data Input Arguments

Required?

Data Input

no

Output

True

If the keyword passes successfully

False

If there is an error

Error Conditions

Conditions

Message

Debug Info

When keyword “LoadSeleniumJS” is not added to the Test Step.

Oops! Seems like ‘SeleniumJS’ is not added in your package or not installed with the agent. Kindly contact OpKey Support Team at support@opkey.com for assistance.

Oops! Seems like ‘‘SeleniumJS’ is not added in your package or not installed with the agent. Kindly contact OpKey Support Team at support@opkey.com for assistance.

Example

VisualComparisonForPage

This Keyword is used to compare the specified web page with the same web page at runtime based on the specified parameters. It doesn’t take any object input argument. It takes few mandatory and optional data input arguments.

 

Input Arguments

 

Object Input

Arguments

Required?

Description

Object

No

This keyword does not take any Object Input Argument

 

Data Input Arguments

Required?

Description

ImageName

Yes

Iteration1: Provide the name of the image to be fetched during iteration 1 to be compared.

Iteration2: Provide the name of the runtime (iteration 2) fetched image to be compared with the existing baseline image (fetched in iteration 1).

ImagePath

Yes

Iteration1: Provide the storage path of the image to be fetched during iteration 1 to be compared.

Iteration2: Provide the storage path of the image (fetched in iteration 2) to be compared with the existing baseline image (fetched in iteration 1).

ValidateBaseline

Yes

Iteration1: Set False for capturing screenshot of the web page.

Iteration2: Set True for comparing image screenshot with the existing baseline image.

ValueFullPageScreenshot

Yes

Set False

Note:
There would be two Test Iterations. First iteration is used to fetch Website visual attributes while in iteration 2, it compares previous fetched visual attributes (iteration 1) with the current visual attributes and prepares HTML report.

Output

True

If the keyword passes successfully

False

If the keyword fails

Example

Suppose, you want to compare User Interface of the Apple Login page then you can use VisualComparisonForPage keyword. In first iteration, it captures an image of Apple Login page and stores at given path. In second iteration, it creates three different images (BaselineImage, ActualImage & Comparison) and provides compared image of the site.

In iteration 1, it captures a screenshot of the web page, stores it at the specified location with the given name. In iteration 2, it creates a folder named as Result which further contains a sub-folder named as per your Test Case. this sub folder contains three images named as ActualImage, BaselineImage & ComparedImage along with a HTML file named as visualOutput.

ActualImage: This image is the actual screenshot of the web page.
BaselineImage: This image is the screenshot of the web page fetched at iteration 1.
ComparedImag: This image is the compared screenshot captured at iteration 2.

visualOutput HTML file contains all the tree images (ActualImage, BaselineImage & ComparedImage).

For example, in the above screenshot, if you want to compare the visual aspects of the Apple Sign in page then select then you can use the keyword “VisualComparisonForPage” as follows:

Note:
While using this keyword, you need to create a Test Case and use this keyword with valid arguments which will capture the screenshot. After That, you need to execute the same Test Case by providing valid data input arguments which will compare the previously captured screenshot with the runtime screenshot. Valid data input arguments as given below:

Data Input Arguments (For capturing screenshot) in Iteration 1:

Data Input Arguments (For comparing screenshot) in Iteration 2:

Common Error conditions

 

Scenarios

Error Message

Debug Information

When ImageName is blank & ImagePath is invalid under Data Input arguments.

Argument Data Missing (-13200)

Argument(s) : (ImageName;) is/are blank.

When the ImagePath is blank, ValidateBaseline & FullPageScreenShot are True

Argument Data Invalid (-13300)

Given Path is Not Valid. Please Check

Was this article helpful to you? Yes 2 No