Howto dynamic steps with KIF

One of my latest tasks was to write some KIF. tests for our iOS applications. If you are not familiar what KIF. is or what it does, here is a brief intro...
KIF. is short for Keep It Functional. It is an open source test framework written by Square Inc and hosted on GitHub.
Now that you are somewhat familiar with what KIF is and how to use it, this guide will show you how you can have more or less dynamic steps. By dynamic, I mean that you could have a setup that looks like this:

HOWTO: Verify that every element of a server's response is valid using SoapUI

It has been a while since my last blog entry, so I though that I would write something up about a recent problem that I had to solve.

Here is the problem that I was faced with: Send a request to a server, make sure that every element of an array in the response is valid.

My initial approach was to convert the JSON response to a XML object and then traverse the object hierarchy verifying only the elements we are interested in.
Below you will find both scripts that solve my problem.

1) XML Method:

Howto block unwanted requests to your apache server with DD-WRT

Recently I made a mistake while configuring my Apache web server and the whole world found out that I have an open proxy (which I don't... at least not anymore). My apache was bombarded with proxy requests and I could barely load up any of my websites (this blog included) from both internal network as well as from outside. So, I started to search the web in hopes of finding people with similar problems and their solutions. Here is what I have found on this website:

How to prevent running a Jenkins job if another job has failed

For my automated tests to run on regular basis (e.g. every night at 1am), I have created to Jenkins jobs:
1) Job to compile the build, which will be used to run my automation against
2) Job that actually runs my automated tests

My constraints were as follows:
1) If compile build has failed, automation build should not be executed and should be failed with an appropriate message
2) If compile build succeeds, automation build should download compiled binaries and work with them.

Access DD-WRT web interface via apache's reverse proxy

Recently I started having problems accessing my DD-WRT web interface via a subdomain of mine. For some reason the web interface would not apply any of the CSS styles and thus making it completely useless. After viewing page's source code using Chrome browser, I found out that clicking on any css links resolved in 400 Bad Request Cross Site Action detected!.

After some googling, I've stumbled upon a forum post that provided a solution, which is quite simple: remove the referer header from the request.
Here is how I did it:

HOWTO: Share multiple folders with multiple ftp users in linux

So, you are running an FTP server and are trying to share some folders outside of user's home path with multiple users? Well, there are couple of ways you can go about this problem:
1) Do no chroot users to their own folders and create a link that points to folders you are trying to share
2) Chroot each user to his/her own home folder and create a link for every file/folder you are trying to share
3) Chroot each user to his/her own home folder and mount folder you are trying to share inside user's home folder

HOWTO: Long press with KIF

If you are using KIF as a testing framework for your iOS application and you need to perform a long press, you have to write your own method or step as it is not included in the source as of this writing. As it turns out the solution is quite simple - tap at a point, wait for a certain timeout, and release the tap.

To implement this behavior, we are going to modify one of KIF's files. In particular, "KIF/Additions/UIView-KIFAdditions.m". At the end of the file, add the following code:

HOWTO: Launch IPhone Simulator with Selenium

If you are trying to test a website on an IPhone Simulator, most likely you are using Selenium's WebDriver. If you are, I'm assuming that you've already compiled the project on your machine and saw that it launches IPhone Simulator with WebDriver app running on it. If you haven't done that yet and need to know how to do that, read this page as it tells you exactly what to do!