Using jQuery to give your user a “check all” option in the UI

Say you have a table where each row contains a check-box and you want to be able to check/uncheck every single check-box based on some action the user does. Using jQuery this is very easy. Assume we have the following HTML: Then the following jQuery snippet will transform the HeaderCheckbox into a control that automatically […]

Read more
knockout.js: Your observable isn’t seeing changes made to text controls until they lose focus
Knockout.js logo

knockout is great library that’s easy to use. One thing I noticed is that changes made in text-controls are only propagated to the observable once that control loses focus. If you want changes in a text-control to immediately be reflected in your observable, then avoid the value binding and use the textInput binding like below:

Read more
Entity Framework and the error: Cannot attach the file ‘xxx.mdf’ as database ‘xxx’

Say you’re working on a project that’s using Entity Framework to manage the database storage in a SQL Server Express installation. If you delete the .mdf file you’ll keep on getting the error” Cannot attach the file ‘xxx.mdf’ as database ‘xxx’. To solve it, in visual studio go to the Package Manager console and run […]

Read more
Migrating from YouTrack to JIRA

Recently I wanted to migrate about 400 issues and 350 attachments from a YouTrack OnDemand instance to a JIRA InCloud instance. JIRA doesn’t provide an importer that is compatible with YouTrack, so I coded a quick .Net C# application that migrated the data for me. I started with quick list of my must- and nice-to-haves: […]

Read more
Highlighting webelements from Selenium

When I’m using selenium to navigate through a web-app, I like to record the session and visually highlight the DOM elements that my testscripts are using. The IWebDriver and IWebElement interfaces don’t supply a method for this….so we’ll have to build our own. The approach I use, is to inject some JavaScript into the webpage […]

Read more
grepping in Powershell

Many unix/linux users are intimately familiar with regular expressions and using them with grep, sed or awk in a pipeline. A typical usage scenario is the following command: So how do we do grep in PowerShell? Well, we can use PowerShell’s operators: Operator Description -match Matches its input property agains a regular expression. By default […]

Read more
How to programatically download attachments from YouTrack

In a previous post I showed how to retrieve your bugs, comments and attachments from YouTrack. However, actually downloading each attachment is a little more work. Assume that the variable Url contains a value like “http://xxxxx.myjetbrains.com/youtrack/_persistent/yyyyy.doc?file=xx-xxx&v=0&c=false” The following raises a HTTP NotFound exception: As does this: The following will raise a HTTP NotAuthorized exception because […]

Read more
Exporting your bugs out of YouTrack

If you need to export your bug reports from your YouTrack instance, this is how to get it done using C#. Its a small example that will print all the issues,comments and attachments for each project in your instance. Don’t forget to enable the REST API in your YourTrack settings page. Create a new project […]

Read more
Combining SpecFlow and Selenium

One of the cool things I like to do when testing webapps, is to define the testcases using SpecFlow (also known as Cucumber) and then use Selenium to actually execute the testcases against the web-application. Here is an example testcase: And here you can see Selenium using Firefox to perform all the actions and checks:

Read more