To learn how to use Selenuim JavaScript keywords in Opkey, you can read Using Selenium JavaScript Keywords - New UI and Using Selenium JavaScript Keywords - Opkey Classic.
Now let's go through the list of various web keywords:
SetViewPort
This keyword sets the Page Layout according to the given dimensions. It is used to open any website/browser in the Mobile View.
Example
Suppose you want to set the Page Layout according to the given dimensions, then you can use the SetViewPort keyword as follows:
SetViewPort
Width | 412 |
Height | 732 |
Browser with Width “412” & Height “732”
Test Object
Input Data
Output Data
Common Error conditions
3. ValidatePageAccessibility
This keyword validates the Page Accessibility at run time and will generate an Accessibility Report which contains the required page Accessibility.
Test Object
Input Data
Output Data
Error conditions
There are no error conditions for this keyword.
.
4. 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.
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 | xls |
Test Object
Input Data
Output Data
Error conditions
5. 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.
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 |
Test Object
Input Data
Output Data
Error conditions
There are no error conditions for this keyword.
6. VisualCheckPointSetting
This keyword sets prerequisites for the Visual QA. It takes the required settings need to perform the Visual QA on responsive websites.
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 |
Test Object
Input Data
Output Data
Error conditions
7. 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.
Example:
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.
Test Object
Input Data
Output Data
Error conditions
To learn how you can use these keywords in test scenarios, you can visit https://university.opkeylms.com and enroll in our Opkey series course.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article