Using ProjectLocker to keep your code safe

I am working on a project at the moment which needs some source control. Which project doesn’t after all, I need remote access to this project so my local git repositories weren’t going to work.

I stumbled across this free git repository ProjectLocker, they support both SubVersion and Git and it is free for up three projects and 300Mb. Luckily the project I am working on isn’t that big so I went ahead and signed up.

I’m not going to go into how to use Git etc, etc. Just let you know about a little gotcha. When you try and upload your first piece of source code you may receive a permission denied error. It will hint that your password is incorrect by keep on asking you for the password again and again. It will be because you haven’t added a public key. Thanks to the blog article by Ben Bahrenburg for this http://blog.bahrenburgs.com/2010/01/using-git-with-projectlocker-on-mac.html

New Gist

Getting started with gist

I’ve tried lots of things for sharing and posting code and none have really worked the way I would like. I recently tried Gist

Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository.

More >

How to set a hidden field value in Selenium

For a project I am currently working on I have been trying to set a hidden field value using Selenium. This proved more difficult than I thought so I thought I would share how to do it. I decided to use Javascript to set the hidden field value, using Selenium you can run a script using the RunScript command.

To get access to the hidden field you have to prefix document.getElementById(...) with this.browserbot.getCurrentWindow() I was then able to successfully set a hidden field from within an automated acceptance test.

var script = "javascript{ this.browserbot.getCurrentWindow().document.getElementById('destination-id').value = '#{value}'; }"
Selenium.RunScript(script);

The reason for this is because by default the code snippet wil run in the runner’s test window, not in the window of your application.