Troubleshooting - CognizantOpenSource/Cognizant-Intelligent-Test-Scripter GitHub Wiki

Error in Connection

Follow the below steps for such scenario:

Checking Connection status and establishing the same

For Chrome and Firefox:

Follow the steps below to troubleshoot the "error in Connection" error message,

  • Open the options window, right-click the add-on to launch options window in chrome and use the shortcut Ctrl+Shift+O in firefox for the same.

  • Launch spy or heal or record from the Cognizant Intelligent Test Scripter's IDE

  • Click on Test Connection, use the default port 8887, this port can also be changed as per your choice.

  • If you are getting a red bulb, the certificate is not installed properly, so click on the bulb again, you will be navigated to the url https://localhost:8887/status, you need to give "Proceed to unsafe" in chrome and Add exception in Firefox to get to this link,

  • If you do not get this message then you need to install the certificates manually.

  • Please follow the steps here here to install certificates manually for different browsers.

NOTE: A green bulb indicates that the connection between browser extension and the UI is established and is working fine.

NOTE: For IE, you need to launch the record or spy or heal from the the UI and launch the URL https://localhost:8887/status to see the above connected. If you do not get the above message then you need to install the certificate manually using the steps explained here

If the issue, still persists, then do the following steps,

  • Configuring Proxy Setting
- If you are behind any proxy then add **localhost** in the
Exceptions.
  • Changing Java Version
  • If the above troubleshooting didn't help you. please update your System Java version by updating System Java Path to latest Java
- Go to **location Where Java is installed>java>jdkx.x.x_xx>jre>bin and copy the path**
- Click on Windows
**StartButton>Computer>RightClick>Properties>Advance
system settings>Environmentvariables** under system variable
append the path copied in step to the PATH environment variable.
  • After updating Java path restart Cognizant Intelligent Test Scripter.

  • Check the connection status and establish the same once again

Significant Details To Consider Before Cognizant Intelligent Test Scripter Installation

Before Installing in the machine, refer the following troubleshooting steps

  • Java Version Supported – Java version that the you have on your system must be supported by the current version of CITS, the same can be checked using Java –version command on command prompt.

  • Install in a location with sufficient rights and privileges

  • Install in a new folder.

  • Script execution in different browsers, don't require the add-ons to be installed in the respective browsers.

  • To use the Cognizant Intelligent Test Scripter add-ons, ensure the following versions are supported,

    - Chrome: Version 40 and above
    - Internet Explorer: Preferably latest
    - Firefox: Version 45 and above
    

What Files Should Be Maintained In Version Control Systems?

Cognizant Intelligent Test Scripter can be checked in SVN, and the projects can be used version controlled and be used across the team members of the projects.

Below is the list of folders to be checked in SVN

  1. Project folder within Cognizant Intelligent Test Scripter

  2. lib/cognizant-intelligent-test-scripter-engine-<version_number>.jar (required if any changes are made in eclipse version)

  3. Engine Folder (In case you have any custom methods, placed in it)

  4. Configuration/Report Template (If changes are made to report template)

  5. All the custom function containing java files used for inject script.

  6. /lib/commands - if there is any jar containing the custom method.

Furthermore, the checked in Project in SVN can be integrated with Jenkins and the execution can be triggered. Additional folders that needs to be checked in SVN for Jenkins Integration

  1. Lib folder

  2. Configuration/Global Settings.properties

  3. cognizant-intelligent-test-scripter-ide-<version_number>.jar

  4. Run.bat

IE – Protected Mode Settings are not the same for all zones issue

Problem: When the Protected mode setting in IE is not same across all zones, then Selenium throws an exception as.

|--| Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stack trace information)

Solution:

  • In Cognizant Intelligent Test Scripter navigate to Configuration > Browser Configuration and Manage Browser tab

  • Select the Browser as IE and Provide the below capability.

  • Capability name : ignoreProtectedModeSettings

    • value: true

Now you should be able to run your scripts in Internet Explorer even though there is a change in protected mode settings across Zone.

How To Configure A Browser Before Executing A Test Case?

Sometimes test execution or other browser-related activities fail due to some configuration settings. Few browser configuration settings that need to be changed for proper execution are listed in this page.

Zoom Level Set To 100%

Internet Explorer

  • Go to the lower right of the browser.

  • Enable Experimental Features.

  • To change the zoom level, click the drop-down arrow.

  • Select 100% (or use the keyboard shortcut: Ctrl + 0).

Chrome

  • Click the Tools icon on the top right corner of the browser

  • Use the plus (+) and minus (-) buttons beside Zoom to set it to 100% (or use the keyboard shortcut: Ctrl + 0).

Firefox

  • On the main menu, click View.

  • Click Zoom from the drop-down list.

  • Click Reset from the list of zoom options displayed (or use the keyboard shortcut: Ctrl + 0).

Disable\Enable Protected Mode In Internet Explorer (Windows Vista/7)

  • On the top right corner of the browser, Click Tools > Internet Options.

  • The Internet Options window is displayed.

  • Click the Security tab

  • Uncheck\Check the Enable Protected Mode checkbox.

  • Click the following options and repeat the process above:

    • Internet

    • Local intranet

    • Trusted sites

    • Restricted sites

Note: The ultimate per-requisite (Selenium pre-requisite) is that the settings should be the same for all the zones (either check or uncheck).

You can also ignore the protected mode settings, click here [#IE – Protected Mode Settings are not the same for all zones issue] for more information.

Allow Local Files To Run Unhindered In Internet Explorer

  • On the right corner of the browser, Click Tools > Internet Options.

  • Click the Advanced tab.

  • Check Allow active content to run in files on My Computer checkbox in the Security section.

Ensure JavaScript Is Enabled In Internet Explorer

  • On the right corner of the browser, Click Tools > Internet Options.The Internet Options window is displayed.

  • Click the Security tab.

  • Click Trusted sites.

  • Click the Custom level.

  • Scroll down until you find the Active scripting in Settings under the Scripting section.

  • Click the Enable radio button

JIRA Integration

In addition to Zephyr addon to JIRA, we need ZAPI, an addon to Zephyr to be installed. This is required to establish the connection with JIRA and update the test results from Cognizant Intelligent Test Scripter programmatically.

Additional details, click here,

How to resolve Internet Explorer Known Issues?

While automating some applications in IE, we may sometimes overcome certain issues such as browser has stopped working and not responding. Note: Cognizant Intelligent Test Scripter is not related to any of these kinds of issues. These are IE and Selenium-based issues that needs to be resolved separately.

Allow Active Contents In Internet Explorer

  • Open Internet Explorer. Click on Tools icon

  • Click Internet Options. The Internet Options window will be displayed.

  • Click on Advanced tab.

  • In Settings, scroll down to the Security section.

  • Check the Allow active content to run in files on My Computer* checkbox.

Internet Explorer Has Stopped Working

Method 1: Reset Internet Explorer

  • Open Internet Explorer. Click on Tools icon

*Click Internet Options. The Internet Options window will be displayed.

  • Click on Advanced tab

  • Click Reset.The Reset Internet Explorer Settings window will be displayed.

  • Check the Delete personal settings checkbox.

  • Click the Reset button. All Internet Explorer settings will be reset to its default condition.

Method 2: Disable Software Rendering

  • Open Internet Explorer. Click the Tools icon.

  • Click Internet Options. The Internet Options window will be displayed.

  • Click the Advanced tab.

  • In Settings, uncheck the Use software rendering instead of GPU rendering* checkbox in the Accelerated graphics section.

Method 3: Uninstall Unwanted Toolbars

  • Remove Unwanted Toolbars from Control Panel

Method 4: Disable Unwanted Add-ons

  • Disable Unwanted Add-ons from Internet Explorer.

Method 5: Get The Name Of The File Which Causes The Conflict

  • Right-click My Computer. Click Manage. The Computer Management window is displayed.

  • On the left pane, expand Event Viewer by clicking it.

  • Expand Windows Logs.

  • From the expanded options, click Application. All system logs will be listed on the right pane.

  • Scroll down and locate the red-alerted Error related to iexplore.exe.

  • To view the details of the error message received on Internet Explorer, double click Error. (that log was created when you get error message on internet Explorer, so please find by the "Time"). The Error Message details are displayed.

  • From the displayed details, find the .dll file name, which has been conflicting with iexplore.exe..

  • Now stop the conflicting via repair, rename or delete that file. Do a research on what has to be done with that file.

Unable To Open Cognizant Intelligent Test Scripter After Introducing Your Custom Method?

This happens when the cognizant-intelligent-test-scripter-engine-<version_number>.jar found in Cognizant Intelligent Test Scripter installation_location/lib, gets corrupted while exporting the cognizant-intelligenttest-scripter-engine-<version_number>.jar back from Engine or while inject script is performed. You might get an exception stating that main class not found.

To overcome this issue, always take a backup of the cognizant-intelligent-testscripter-engine-<version_number>.jar before you export the jar from Engine. So even when the jar is corrupt you can still replace the existing jar by the new one. Also do not change the name of the cognizant-intelligent-test-scripter-engine-<version_number>.jar available inside the lib folder.

Another alternative is to delete the recent items file present in the installation location when Cognizant Intelligent Test Scripter is closed and open again.

Note: Please do not take the back up in the same location or inside the lib folder. Place it in a different location.

If you face this issue after performing inject script then delete the .class file of your custom method found in the userdefined folder of installation location and close and reopen.

Note: This could also be because the .jar files present in the location\lib\commands might have got corrupted. So you can simply remove those files to open Cognizant Intelligent Test Scripter.

Check points to consider before connecting to QC

If you are facing issues while connecting Cognizant Intelligent Test Scripter to QC and getting the following exception,

could not initialize the com4j.COM4J

Follow the steps below to trouble shoot the same,

  • Check if your system is 32 or 64 bit

  • If your system is 64 bit, then please install a 32 bit java in your system and then right click on the Run.bat file and choose Edit option

Comment the line below,

java -Xms128m -Xmx1024m -Dfile.encoding=UTF-8 -cp cognizantintelligent-test-scripter-ide-1.0-SNAPSHOT.jar;%APP_CLASSPATH%;
com.cognizant.cognizantits.ide.main.Main %*

Suppose your 32 bit java is installed in the following path, C:\Program Files (x86)\Java\jdk1.8.0_74\bin\java.exe, then add the following line instead of the commented line above,

"C:\Program Files (x86)\Java\jdk1.8.0_74\bin\java.exe" -Xms128m -
Xmx1024m -Dfile.encoding=UTF-8 -cp cognizant-intelligent-testscripter-
ide-1.0-SNAPSHOT.jar;%APP_CLASSPATH%;
com.cognizant.cognizantits.ide.main.Main %*

Note: If you still face issues while connecting to QC, then uninstall and once again install(or re-install) the TDConnection.exe

How To Hard Code Java Path Variable For Cognizant Intelligent Test Scripter

It is possible to hard code the java path in the Run.bat file. Refer the section below on how it can be done.

Prerequisites

Following must be installed in your system:

  • Cognizant Intelligent Test Scripter setup

  • Java

How to do it?

  • Navigate to the location where Cognizant Intelligent Test Scripter is installed in your system.

  • Right-click the Run batch file.

  • Click the edit option in the context menu.

  • Give the path of the jre location under the 'SET PATH' like this, SET PATH="C:\Program Files\Java\jdk1.x.x_xx\jre\bin".

  • Save the file.

  • Double-click the Run.bat file and launch Application.

How To Access Virtual Browsers?

By default, Selenium searches for browser exe file in the local file system. If browser is installed virtually, the web-driver profile must be updated with the target location of the browser's exe. This can be done with the help of the following instructions:

Browser Profiles For Different Browsers

Chrome Browser

Place the following code in CustomWebDriver.java before the initialization of ChromeDriver:

ChromeOptions options = new ChromeOptions();
options.setBinary(new File("/path/to/chrome exe"));
ChromeDriver driver = new ChromeDriver(options);

Firefox Browser

  • Place the following code in CustomWebDriver.java before the initialization of FirefoxDriver:
System.setProperty("webdriver.firefox.bin", "Firefox exe location");
WebDriver driver=new FirefoxDriver();

The same method can be followed for other browsers.

System.setProperty("webdriver.firefox.bin", "Firefox exe location"); WebDriver driver=new FirefoxDriver();

As per Chrome version - 51.0.2704.106, we will be able to add a new custom device and switch off mobile no touch mode to spy the objects from Cognizant Intelligent Test Scripter Mobile Spy. Please refer the link

For existing list of devices, we may not be able to turn off mobile-no touch mode directly. As a work around, we can select Responsive, alter the dimensions according to the mobile screen, and select the Mobile (No touch) option as shown below: