Monthly Archives: November 2016

TOSCA Continues Integration with Team City

Posted on by 0 comment

After installing TOSCA 9.3, TOSCA CI related program should be under C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\ToscaCommander\ToscaCI.

Preparation in TOSCA work space

  • Create a execution list folder and set attribute ContinuousIntegrationBuildRootFolder to True
  • Create execution list with attribute ContinuousIntegration=True and a desired value for Executiontype
  • Add test cases which you plan to execute to this execution list.


TOSCA CI professional license is required for using CI configuration file.
Since we will trigger the execution from TeamCity, the TOSCA CI client could be triggered under system account, under that the UI automation will be blocked. So the TOSCA CI Remote Execution Service will be used to execute the test cases.
In this case, we will only need to configure the remote execution service endpoint. It could be on local or remote machine, but it should be started under normal admin account.

TOSCA CI Remote Execution Service

Attributes below in ToscaCIRemoteExecutionService.exe.config should be configured based on your configuration.

  • WorkspacePath
  • LoginName
  • LoginPassword

Unattended Execution

  • The screen saver should be disabled
  • The system should not be locked at any time, a action RDP session should be kept
  • Or Auto logon is enabled, and use VNC or teamviewer to remote connect to the system
  • the system is logged in with the same user which starts the ToscaCIRemoteExecutionService

Team City Integration

Build Steps

Generate TOSCA CI configuration file

  • Runner Type: Powershell
  • Script: Source
  • Script source:

Tests Execution

  • Runner Type: Command Line
  • Run: Executable with parameters
  • Command executable: C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\ToscaCommander\ToscaCI\Client\ToscaCIClient.exe  
  • Command parameters:-m distributed -c “c:\Temp\CIExeConfig.xml” -t junit -r “c:\temp\result.xml” -x True

Display test result in Team City

In Build features, add a new build feature with following details:

  • Report Type: Ant JUnit
  • Monitoring rules: c:\temp\result.xml
Category: Team City, TOSCA

FindElements By JQuery locator

Posted on by 0 comment

Lots of websites use JQuery, and JQuery selector has more features than Css locator, such as contains etc. So try to use Javascript Executor to execute JQuery selector and return the WebElements.

Category: C#, Selenium

Accessing Jira with OAuth Authenticated request

Posted on by 0 comment

Based on Jira OAuth authentication using DotNetAuth, we can successfully get the access token, and are able to make an authenticated request. Now we plan to use Atlassian.SDK to access Jira with oAuth authentication, but currently Atlassian.SDK only supports basic authentication. So we will need to inject little bit extra code to make this happen.

Used packages

  • Atlassian.SDK 8.5.0
  • RestSharp 105.2.3
  • DotNetAuth
  • Current DotNetAuth 1.0.5 nuget package uses old RestSharp version, and it doesn’t work with RestSharp 105.2.3, so small changes is required to align with this new RestSharp. The original DotNetAuth code can be downloaded from here.

    Integrate DotNetAuth in RestSharp RestClient

    A customized Authenticator is required to let RestClient know how to do the authenticate with DotNetAuth. This will be used when creating the RestClient.

    Once we have OAuth1aAuthenticator, we can create Rest Client with code below,

    Integrate oAuth in Atlassian.SDK

    Create a new class (JiraOAuth) which inheritants from Jira.Jira. In it, a static method called CreateRestClient is created which accepts oAuth authentication details and will return Jira instance.

    Then we can call below to create Jira instance.

    Now we have oAuth authentication support in Atlassian.SDK, the only difference is to use the new CreateRestClient to create the Jira instance, all the rest will remain the same as using basic authentication.

    Category: C#, Jira, OAuth