Blog

Latest Updates. News. Insights. Ideas.

troubleshooting Archives - Sahi Pro

Common mistakes while using Sahi Excel Framework – Data Driven Testing

Posted by | Sahi, troubleshooting, tutorials, Uncategorized | No Comments

Sahi Excel Framework is a powerful feature which bridges the gap between domain experts and automation engineers. We had highlighted Sahi Excel Framework in our Five Questions Series here: http://sahipro.com/five-questions-series-sahi-excel-framework/

In this post, we intend to highlight the common mistakes people make while using Sahi for Data Driven Testing

Syntax and Data File Errors:

  • Missing = after the variable name.
    Some testers seem to read the external file and store the data (array) in a variable. They miss out the = after the variable name.
    Incorrect Usage:
    variableName _readCSVFile(“fileName”)

    Expected Usage:
    variableName= _readCSVFile(“fileName”)Error

  • A common mistake observed was the usage of _readCSV, _readExcel instead of _readCSVFile and _readExcelFile.
  • Using the incorrect API to read the external files
    There are three APIs you need to be aware of: _readCSVFile, _readExcelFile and _getDB. You need to use these APIs based on where you are saving your test data which could be CSV, Excel or a database.
  • First column is not empty. There should not be any data under the first column header.
    Expected: BlankColumn
  • Mismatch in the header names. The data from the column will not be considered if the header name doesn’t match in the scenario file and data file.
    Headers
  • Keyword and Data are not enclosed in square brackets
    [Keyword][Data]
  • Instead of [variable:header:columnName], many testers have used [variable:header.columnName] They have used . instead of : and you would notice that the values would not be picked up for the fields.
    DataNotPickedUp

Which other issues have you encountered while using Sahi Excel Framework for Data Driven Testing? Do let us know through your comments.

Sahi Pro: Troubleshooting Series: Remote Desktop Connection (RDC)

Posted by | technical, troubleshooting | No Comments

Last week, we saw how to troubleshoot SSL issues.
Similarly, during automation, one might have to do a remote desktop connection (RDC) to multiple machines and there are chances of minimizing or closing the RDC connections. In this blog post, we discuss the solutions to problems with native elements if the RDC is minimised or closed.

Scenario 1: Minimised Remote Desktop Connection
When tests are executed on a remote machine using Remote Desktop Connection and the RDC window remains minimised, native events (including taking screenshots) fail to work.
To fix this, one needs to add registry keys on the client machine from which the Remote Desktop Connection is made.
NOTE that these keys are to be modified on the client and not the remote machine.

Please be careful while changing the registry entries.

Registry Editor

  • Launch the Windows Registry as appropriate on your Windows machine
  • For 32-bit Windows, find the registry key:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client
  • For 64 bit Windows, find the registry key:
    HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Terminal Server Client
  • Create a DWORD value with the name RemoteDesktop_SuppressWhenMinimized with value 2.
  • Run the tests.

Now native events should work well with a minimised Remote Desktop Connection.

Scenario 2: Closed Remote Desktop Connection
Sometimes users would want to open a Remote Desktop Connection, start running the tests on the remote machine, and close off the connection from the client while the tests are running.
In this case, native events (including taking screenshots) fail to work.

To work around this, please do the following instead of closing the remote desktop connection directly.

  • Create a batch file on the Remote machine’s Desktop (For example: “disconnect.bat”).
  • Type the following line in the file –
    tscon %sessionname% /dest:console
    and save it.
  • Start off the tests on the Remote machine.
  • Do not close the Remote Desktop Connection from the client directly.
  • Instead, double click on the batch file. The session will be closed by the remote desktop.

    Now native events should work well with the closed Remote Desktop Connection.

Scenario 3: Right Click > Paste (Clipboard) missing in RDP (RDC)

Clipboard Checked

Even though you have ensured that Clipboard is checked and available during the remote session, when you do a right click after a copy, the paste option might be disabled.

All you need to do is to kill the clipboard process and restart it again! You can do so by running the following command from the windows run command (Windows Key + R) or cmd (on the remote machine):

Taskkill.exe /im rdpclip.exe

The command above will kill RDP Clip Monitor process, and then you can restart the process again by running the following command:

Rdpclip.exe

It should start the process again and the clipboard should start working again now

Refer the following link for more information:
https://www.svenbit.com/2014/11/restart-copy-and-paste-clipboard-functionality-in-rdp/

Hope this post gave you information about troubleshooting RDC issues. Feel free to let us know if you face any other issues by sending an email to support [AT] sahipro [DOT] com

We will cover those in the upcoming posts.

SahiPro Troubleshooting Series: SSL Issues

Posted by | technical, troubleshooting | No Comments

We take pride in helping our customers solve their automation issues. We are planning to come up with a list of commonly faced issues and how we solved it. This might help multiple customers when they face similar issues. Over a period of time, this would turn into a good repository of problems and solutions.

Today, we share the common problems faced by our customers with SSL

Issue 1: Certificates does not conform to algorithm constraints
Certificates does not conform to algorithm constraints

Sahi Pro Console Error

javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: Ce
rtificates does not conform to algorithm constraints
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source
)

Solution:
Please perform all the steps highlighted below:
  • Open C:\Program Files\Java\jre1.8.0_111\lib\security\java.security file.
    The above path is for jre version 1.8.0_111. In your case, it might be different.
  • Search for the lines
    jdk.certpath.disabledAlgorithms=
    jdk.tls.disabledAlgorithms=
    jdk.jar.disabledAlgorithms=
    and comment them by prefixing # such that they look like this:
    #jdk.certpath.disabledAlgorithms=
    #jdk.tls.disabledAlgorithms=
    #jdk.jar.disabledAlgorithms= 
  • Open <SahiPro>/bin/dashboard.bat file and modify below lines fromjava -Djsse.enableSNIExtension=true -Djava.util.logging.config.file=%SAHI_USERDATA_DIR_TMP%\config\log.properties -classpath %SAHI_EXT_CLASS_PATH%;%SAHI_CLASS_PATH% net.sf.sahi.ui.Dashboard “%SAHI_HOME%” “%SAHI_USERDATA_DIR_TMP%”
    to
    java -Djsse.enableSNIExtension=true -Dhttps.protocols=SSLv2Hello,TLSv1,TLSv1.1 -Djava.util.logging.config.file=%SAHI_USERDATA_DIR_TMP%\config\log.properties -classpath %SAHI_EXT_CLASS_PATH%;%SAHI_CLASS_PATH% net.sf.sahi.ui.Dashboard “%SAHI_HOME%” “%SAHI_USERDATA_DIR_TMP%”
  • Save the changes and restart Sahi Pro.

Issue 2: “ERR_SSL_VERSION_OR_CIPHER_MISMATCH”
SSL_VERSION

Solution:

  • Please modify the following property in <SahiPro>/bin/dashboard.bat by toggling the value from true to false or false to true.
    -Djsse.enableSNIExtension=true
    or
    -Djsse.enableSNIExtension=false
  • Save the changes and restart Sahi Pro.

Issue 3: ERR_SSL_PROTOCOL_ERROR
Protocol
Solution:

  • Take a back up of <SahiPro>/bin/dashboard.bat and modify the following fromjava -Djsse.enableSNIExtension=true -Djava.util.logging.config.file=%SAHI_USERDATA_DIR_TMP%\config\log.properties -classpath %SAHI_EXT_CLASS_PATH%;%SAHI_CLASS_PATH% net.sf.sahi.ui.Dashboard “%SAHI_HOME%” “%SAHI_USERDATA_DIR_TMP%”
    to
    java -Djsse.enableSNIExtension=true -Dhttps.protocols=”SSLv3,SSLv2Hello,TLSv1″ -Djava.util.logging.config.file=%SAHI_USERDATA_DIR_TMP%\config\log.properties -classpath %SAHI_EXT_CLASS_PATH%;%SAHI_CLASS_PATH% net.sf.sahi.ui.Dashboard “%SAHI_HOME%” “%SAHI_USERDATA_DIR_TMP%”
  • Save the changes and restart Sahi Pro.

    Hope this post gave you information about troubleshooting SSL issues. Feel free to let us know if you face any other issues by sending an email to support [AT] sahipro [DOT] comWe will cover those in the upcoming posts.

HTTPS Problem Resolution: Unable to tunnel through proxy

Posted by | technical, troubleshooting | One Comment
Sahi had been using its own custom implementation of proxy tunnelling till a few months back. Owing to a lot of demand for some features, we moved to Java’s httpsurlconnection which supported tunnelling through a corporate proxy with authentication. 
But unfortunately a bug in Java’s httpsurlconnection was tripping up a few users on some https sites. One case was the failure of websites using login via SiteMinder. 
The exception thrown was  
Unable to tunnel through proxy. Proxy returns “HTTP/1.1 400 Bad Request”
After some research we figured that it was due to this bug 6687282 
Switching to the latest java 1.6.0_14 fixed this issue for us.
Use fully-loaded Sahi Pro FREE for a month. Download Now Request a Demo