psake script in Visual Studio

A sample project will be set up in Visual Studio for writing psake script, Create a new Class Library Project Install Nuget Package – psake Add a default.ps1 file with some test script, or that can be copied from packages\psake.x.x.0\tools\examples default.ps1 Execute the script: Import-Module .\packages\psake.4.6.0\tools\psake.psm1 Invoke-psake .\psake\default.ps1

Team City Meta-Runner for TOSCA CI

In TOSCA Distributed Execution, we discussed how to integrate TOSCA Distributed Execution with Team City, which we have two steps for triggering the execution. Since we need to use them for multiple build configuration, so considering to wrap them one step with Team City Meta-Runner. The Meta-Runner can be extracted from an existing build configuration. In this case, open the build configuration to be extracted, and go to Actions -> Extract Meta-Runner, Enter or adjust values for Project, Name, ID, Description, and then click Extract button, then make changes if required.

Restore MSSQL Database

Kill active sessions Firstly, it would be better to stop all the applications/services which are connecting to the Database which needs a restore. Then, kill the active sessions as this will block the restore process if there are any active sessions. use master; declare @kill varchar(max) = ''; select @kill = @kill + 'kill ' + convert(varchar(10),S.session_id) + ';' from sys.dm_exec_sessions S join master..sysprocesses P on P.spid = S.session_id where P.

Simple Dependency Injection with dynamic finder at runtime

Sometimes, we have multiple methods to be called, but it has to be determined at run time, so try to make it less coupled and use reflection to achieve this. The sample scenario here is for Field Type. We have different implementation for each different field type, such as text, date etc., and at run time, a DoSomething method should be called based on the field type. Firstly, an interface is defined, which has methods called IsValid and DoSomething, IsValid method is used for a certain implementation which is valid for certain Fieldtype.

TOSCA Distributed Execution

This exercise will try out TOSCA Distributed Execution, the benefits of using it are Supports untended execution, creates RDP connection automatically while execution Splits the execution load to multiple agent system Monitors the actual test execution with Test Event Monitor After installing the TOSCA 9.3, the Distributed execution components are under C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\ToscaCommander\DistributedExecution Distribution Server For installing the distribution server, InstallServer.bat under DistributedExecution\Server should be executed, parameter IP address & Port can be assigned if required.

TOSCA Continues Integration with Team City

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 Client 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.

FindElements By JQuery locator

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. public static IEnumerable<IWebElement> FindElementsByJQuery(ISearchContext context, string locator) { var jsContext = context as IJavaScriptExecutor; if (jsContext != null) { var jObjects = (Dictionary<string,object>)jsContext.ExecuteScript(string.Format("return jQuery(\"{0}\")", locator)); foreach (var o in jObjects) { if (!(o.Value is IWebElement)) { continue; } yield return (IWebElement) o.

Accessing Jira with OAuth Authenticated request

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.

Oracle ODBC with Instant Client

Sometimes we don’t want to have full client installed just for an ODBC connection to Oracle Database, so I had a try with Oracle Instant Client. Download & install required packages Instant Client Package – Basic Instant Client Package – ODBC You can download either Instant Client for Microsoft Windows (32-bit) or Instant Client for Microsoft Windows (64-bit) based on your preference. After we have the packages, unzip them into a directory, all the files should be in same directory.

Jira OAuth authentication using DotNetAuth

In this post, we will try to connect to Jira with oAuth authentication in DotNet, I did some research, and mainly followed the instructions on Is there any JIRA OAuth implementation example in .NET and JIRA REST API Example – OAuth authentication Generate self-signed certificate OpenSSL is used for generating the certificate, openssl genrsa -des3 -out private.pem 2048 openssl rsa -in private.pem -outform PEM -pubout -out public.pem openssl pkcs8 -topk8 -nocrypt -in private.