Things You Should Know - CognizantOpenSource/Cognizant-Intelligent-Test-Scripter GitHub Wiki

Environment Based Execution

Environment based execution allows you to configure your test cases to run them in multiple environments. It is achieved by creating data sheets for each environment.

To create data sheets for environment-based execution, please follow the steps below to create new environments and add data sheets to the same

  • Navigate to Test Data>Multiple Environment and click on the Multiple Environment option to enable the same.

  • Click on the '+' sign, as shown in the image below to create a new environment.

  • Give a new name to the environment in the respective option

  • If you want to copy data sheets and global data sheet from selected environment , choose the respective option, as highlighted in the image below.

  • Click on create to create the same

  • After this, just select the environment for execution from Configuration>Run Settings and choose the environment under Environment option

Note: You can also select a test set and save the environment based settings for the same under the Quick Settings section of the Execution Panel. All the test cases in the test set will run with the test data chosen from the selected environment and if the particular data sheet or the column is not available in the environment selected then it will search for the same in the Default set of data sheets.

How To Use Global Data Sheet?

For every project that is created in Cognizant Intelligent Test Scripter, a default global data sheet is generated. The data entered in the global data sheet can be referenced in any test data sheet within the project. This allows you to reuse the data across multiple test cases.

Where to use the Global Data?

Identify the Data column name which is common across multiple data sheets.

Select that data value and click on global data icon, as shown in the image above. Give the global data id, in the respective window, as shown below,

You will get the global id in the global data sheet, as shown below.

How To Rename Project?

  • To rename your project, right click on the project name from the Test Plan section and choose Details from the context menu option.

  • The Project Details window opens and the following options are available in the window, as shown below.

  • To rename your project, give the new name in the Project Name text box and click on Rename. Your project will be renamed.

  • The open option opens the project location in your system.

  • Right below these options, you have details on the total number of scenarios, test cases, reusable components and test data sheets present in the project.

How To Execute Reusable

How To Execute A Reusable Test Case For Desired Set Of Data From The Data Sheet?

A reusable test case can be executed with a desired set of data by providing the sub iteration index in the Input column. It will fetch the data set from the data sheet with the desired index and use it within the test case. This is very useful when you want to execute the same reusable component, inside a single test case, with different set set of data passed each time.

How To Loop?

NOTE: In Test Design panel, users are only given access to Iteration 1 and its various Subiterations

  • For the above image, Steps 11 to 18 will be executed 2 times (equal to the number of Sub iterations for Iteration 1)

    • For first iteration, data will be taken from Iteration 1 and Subiteration 1

    • For second iteration, data will be taken from Iteration 1 and Subiteration 2

  • To repeat an entire Test Case, keep Start Param in the first Step of your test Case and End Param in the last Step of your Test Case.

  • In the above image, we have used End Param:@1. This will execute Step 11 to 18, once and not twice.

  • To iterate through the entire Test Case for all the sub iterations of data in the data sheet, keep Start Param in the first step and End Param in the last step of your Test Case.

How To Use Iterations And Subiterations In The Test Execution Panel?

  • NOTE: In the Test Execution panel, you are given access to all Iterations and their Sub iterations.

  • In the above image, there are some options given under the Iteration column

    • All: will Iterate through all your Iterations of your datasheet.

    • Single: will only Iterate through Iteration 1 of your datasheet.

    • n:n (Range): will Iterate through a range of iterations.

    For example, if you use 2:5, then Cognizant Intelligent Test Scripter will only Iterate through Iteration 2 to Iteration 5 even if there are more iterations.

    • n: will allow you to Iterate a particular (nth) iteration in your datasheet.

    For example, if you use 5, then Cognizant Intelligent Test Scripter iterate only the 5th iteration and all its sub iterations.

Note: Subiterations will work according to the definition of Start Param and End Param in the Test Design panel.

Looping Without Test Datasheet

  • To repeat few steps, use Start Loop and wEnd Loop:@n.

  • In the above image, Start Loop is at Step 2 and End Loop:@5 is at Step 8. So, Step 2 to 8 will be repeated 5 times.

Execution Of Scripts In Safari 10

Consider the following points, taken from the official links, before performing execution in Safari,

  • As a WebDriver test is executing in an Automation window, any attempts to interact with the window or web content could derail the test by unexpectedly changing the state of the page. To prevent this from happening, Safari installs a “glass pane” over the Automation window while the test is running. This blocks any stray interactions (mouse, keyboard, resizing, and so on) from affecting the Automation window.

  • The old Safari Driver implementation is no longer maintained and should not be used. You do not need to download anything besides Safari 10 to get the Apple developed driver

  • Some users reported that they could not get safari driver to run correctly after installing Safari 10 on El Capitan. After installing Sierra the execution occurred Safari’s driver restricts the number of active WebDriver sessions. Only one Safari browser instance can be running at any given time, and only one WebDriver session can be attached to the browser instance at a time.

Note: For more information, refer here

How To Do Web Performance Testing With Cognizant Intelligent Test Scripter?

Create Har files

  • Refer the actions section WebPage Performance Actions of the document to check how to use the Performance testing actions

  • Navigate to Configuration>Run Settings and check the Performance Reporting check box under the Run settings tab.

  • Once this configuration is saved, run your test set and post the execution you will get a report.Expand the report by clicking on your test case and this time the console icon on the bottom right will change into the Performance Report icon.

  • To launch the performance report click on the Performance Report icon.

  • The table and graph view contains the har files generated post execution.Click on them to get the various page and resource timings parameters captured by the capturePageTimings action.

Compare Har Files

To Compare your Har files, navigate to Tools>Har Compare and you will be redirected to the Har Comparator site.

Here you compare the Har files that you have in your project and also set benchmarks for achieving standards.

How To Schedule Tasks With Cognizant Intelligent Test Scripter?

Follow the steps below to perform schedule run

  • Launch Cognizant Intelligent Test Scripter Scheduler by navigating to Configuration>Schedule Run and configure it as per your requirements.

  • Provide the name of your task and test set details and the time and the date on which you want to execute the specified test sets. You can also add the arguments here, these are similar to the command line arguments used in Cognizant Intelligent Test Scripter.

  • Arguments that can be added are

dont_launch_report Disables launching summary report after execution setEnv <arg Create/Set Env settings to override project Settings from Command Line. setVar <arg Create/Set user de􀂦ned variable [-setVar "var=value"] standalone_report Create Standalone Report instead of Relative one Open

*Open windows Task Scheduler (Start>Control Panel>System and Maintenance>Administrative Tools>Task Scheduler) and search for the task you scheduled in Cognizant Intelligent Test Scripter and double click it.

  • Click on Triggers tab then click on Edit

  • Now you can configure it as per your requirements as shown below.

How To Handle Random Actions/Pop up Windows?

In some applications, there may be components which will originate at random ie. the origination of such components cannot be predicted. This section will describe how to handle such components.

Logic

Since the origin of some components cannot be predicted, check for the availability of the respective component before or after performing each step.

How To Do It?

  • Open Cognizant Intelligent Test Scripter Engine in Eclipse IDE (or any IDE supporting java development).

  • Navigate to com.cognizant.cognizantits.engine.execution.run.

  • The following actions will be available in this class Annotation:

    • beforeStepExecution:Enter the code to handle the component here ,if you want to perform the check before the execution of each step.

    • afterStepExecution:Enter the code to handle the component here,if you want to perform the check after the execution of each step.

How To Change Object Properties At Run Time?

Sometimes it is necessary to use a dynamic property for objects at runtime. Customizing the existing properties at runtime can be done by using setObjectProperty and setglobalObjectProperty functions. setObjectProperty function: will update property of the driving object. setglobalObjectProperty function: will update property for all the objects.

setObjectProperty

  • setObjectProperty action can be used by an object.

  • To provide dynamic property value, use the Input column.

  • To provide flag for replacing the property string, use the condition column.

setglobalObjectProperty

  • setglobalObjectProperty action can be used by Browser object.

  • To provide dynamic property value, use the Input column.

  • To provide flag for replacing the property string, use the condition column.

  • Setting Global Object property is optional. To use object with global property when required, set GlobalObject in the Condition column.

Note: It is also possible to use setObjectProperty/setglobalObjectProperty for replacing multiple variables at the same time. Follow the syntax shown in the image below for the same,

How To Change Cognizant Intelligent Test Scripter Report Theme?

  • Go to Configuration>Options Theme.

  • From the Reporting theme, select a theme of your choice.

  • You can also toggle between *Single and Group View.

  • You can choose which columns need to be displayed in the report.

  • Show or hide columns in the report using the show/hide columns option. Check the respective column name checkbox to display that column or uncheck the respective column name checkbox to hide it.

Filtering In Report

You can filter reports using Global Search or Column Search.

Sorting In Report

You can sort the reports using the up/down arrows beside each column name.

How To Generate Run Time Data In Cognizant Intelligent Test Scripter

There are options available in the Input column to perform functions like rounding off numbers, generating a random number, concatenating strings, other arithmetic calculations and etc.

Follow the steps below to access those options.

  • Consider any action that requires Input column. For instance let us take the Print action. Instead of providing the URL directly, you can concatenate two strings that lead to the URL.

  • Consider the custom method below that uses the Data keyword which will process the concatenate function and open the URL.

Note: It is also possible to combine two relevant functions for optimum usage . For example,=Concat(Diaphragm,=Round(360.45)) in the input column will return the following result Diaphragm360.