Miscellaneous - CognizantOpenSource/Cognizant-Intelligent-Test-Scripter GitHub Wiki
How To Customize The Webdriver?
The easiest and recommended way is to configure the machine that will run the test. If that is not possible or you want your test to run with a different configuration or proxy, then you may use the following technique. The technique uses a capabilities object that temporarily changes the system settings and changes it back to the original state after execution.
Follow the steps below to customize your web driver.
-
Open the Cognizant Intelligent Test Scripter Engine
-
Navigate to WebDriverFactory.java which is within the com.cognizant.cognizantits.engine.drivers package
-
Navigate to create function and configure the webdriver based on your requirement.
Adding Capabilities By Using Settings
-
In the UI, navigate to Configuration>Browser Configuration
-
Add the capabilities and its values
-
Click Save. The changes made to the capabilities will be saved.
How To Use Range With Layout Functions?
Layout testing always seemed to be a complex task but Cognizant Intelligent Test Scripter offers a simple solution to it. It tests the location of the objects relative to each other on the page under test. Using special syntax and comprehensive rules, one can describe any possible layout design. This document describes the use of range with layout methods.
Refer the content below for defining range for layout validation.
Exact range
For example: width 100px
Object Name | Input |
---|---|
Primary Object | @100px |
The value between range
For example: width 50 to 200 px
Object Name | Input |
---|---|
Primary Object | @50 to 200 px |
Greater than
For example: width > 40 px
Object Name | Input |
---|---|
Primary Object | @>40 px |
Less than
For example: width < 40 px
Object Name | Input |
---|---|
Primary Object | @< 40 |
Approximate
For example: width ~ 100 px
Object Name | Input |
---|---|
Primary Object | @~ 40 |
Relative Ranges
In case you want to check relative values you can do it by using ‘%’ symbol but then the syntax will be a bit different.
For example: width 50 % of screen/width
Object Name | Input | Condition |
---|---|---|
Primary Object | @50 % | Secondary Object |
Primary Object | @50 to 60 % | Secondary Object |
Primary Object | @~ 40 % | Secondary Object |
How To Use Validations In Cognizant Intelligent Test Scripter?
-
Validations will help you to validate the syntax for your test steps.
-
You can enable/disable Validations by right clicking on the selected test steps and choose Toggle Validation
- Errors will be highlighted in red.
How To Export My Scripts As Manual Test Scripts
Cognizant Intelligent Test Scripter test cases, scenarios and the project can be exported as Manual test case files in .csv format.
Steps to do the same,
-
In the design panel, right click on the test case and choose the option Export As>Manual Testcase from the context menu
-
Provide the location where you wish to save the .csv file
Note: You can also right click on the following to convert them in to manual test scripts,
-
The entire project
-
Scenario
-
Selected scenarios
-
Selected test cases
-
You can also use the option "Export Selected TestCases into Manual TestCases" from the execution panel in order to do the same.
How To Add/Edit New Validations For A New/Existing Action?
Validations can be added to your custom method, using the following annotation before defining your custom method,
@Action(object = ObjectType.BROWSER, desc = "open given url", input =
InputType.NO, condition = InputType.No)
The Action is a predefined method in Cognizant Intelligent Test Scripter, defined as follows,
public @interface Action {
InputType input() default InputType.NO;
ObjectType object() default ObjectType.ANY;
InputType secondObject() default InputType.NO;
InputType condition() default InputType.NO;
String desc() default "";
}
InputType is having the following 3 types,
YES,
NO,
OPTIONAL
ObjectType is of following types,
BROWSER - for browser based action,
WEB -supported only for web objects,
MOBILE - supported only for mobile objects,
IMAGE - supported only for image objects,
SELENIUM - supported for both mobile and web objects,
APP - For an application based action,
DATABASE - For data base testing
ANY - for any other object type
Use secondObject, when a secondary object is required for the action
Use condition, when condition is required for the action
Use desc to give description (string) for the action
Additional Handy Features
Drag And Drop TestData To TestCase
- The test data sheet can be dragged and dropped in to the test case workspace. This can be done by clicking and dragging the respective test data of the data sheet and dropping it under the input section. This will automatically populate the datasheet and column name for the data required for that test step.
Navigating Through Reusable Components
It is possible to open the test steps under a reusable component by navigating to the test step in the workspace and performing Alt+(LeftClick) which will open the reusable component.
Change browser for multiple test cases in a test set
If you have multiple Test Cases in a Test Set, and of you wish to execute certain test cases in a different Browser, please follow the steps mentioned below:
-
Select the Test cases that you wish to execute in a different browser
-
Right-click, go to Change Browser and then select the Browser of your choice.
Now, on executing a test set, the selected test cases will run in the specified browser.
Change Execution Status for multiple test cases in a test set
If you have multiple Test Cases in a Test Set, and of you wish to change the execution status for certain test cases, please follow the steps mentioned below:
-
Select the Test cases that you wish to change the status
-
Right-click, go to Change Status and then select the status of your choice.
- Now,the selected test cases status will be changed.
Select test cases in a test set based on execution status
If you have multiple Test Cases in a Test Set, and of you wish to select the certain test cases based on execution status, please follow the steps mentioned below:
- Right-click on the check box on the left top corner to get the context menu and then select the status of your choice.
Navigate to a particular test case from Test Execution panel
If you have multiple Test Cases in a Test Set, and of you wish to navigate to a particular test case , please follow the steps mentioned below:
- Select the Test cases that you wish to navigate
*Right-click, go to Go To TestCase and then select the status of your choice.
- Now, in the test design panel, your test case will be loaded.
Navigating to TestData, Object,Reusable and Test Case (from the Execution Panel).
From a particular step in a test case, we can navigate to a Test Data Sheet, Object or a Reusable by following the steps mentioned below:
- Select the step and perform right click.
- Select the option Go to. If you wish to navigate to the object mentioned under the Object Column, click the option Go to Object
The object and the page in which it is present in the Object Repository will be highlighted
- If you want to navigate to the test data sheet mentioned in that test step, select the option Go to TestData
The test data and the corresponding column will be highlighted
- If you want to navigate to a reusable component, select the step where the Reusable component is called, right-click and select the option Go to and then select the option Go to Reusable. Then,the Reusable Component will open.
This will render the test steps for the reusable components in the workspace.
- To navigate to a particular Test Case from the Execution Panel,select the Test Case in the Run manager, right-click and select the option Go to and then select the option Go to Test Case. Then,the Test Case will open in the Design Panel.
When to use No Browser?
The No Browser option is useful for scenarios where you do not make use of any browser for executing a Test Case. An example of such a scenario is while automating a desktop application
To make use of No Browser option, right-click the run button and select the option No Browser. Now, no instance of a browser will be created and the test case will be executed.