Friday, January 16, 2015

The game to discredit Imran Khan

The way events have unraveled in the past few days, there is a sign, a very clear sign of a dirty game being played by the establishment of Pakistan, this includes both Military and Civil establishments to discredit the only political leader with public support: Imran Khan.

With PM Nawaz being one of the most discredited persons in the country (Pervaiz Rasheed tops him though) the establishment is now trying to bring down Imran Khan who is the only national political leader with a big support and following. The present government have literally laid itself in front of the military and the Army chief General Raheel Shareef seems to be the foreign minister of Pakistan while the government ministers are mostly there to do press conferences with zero material.

The government chose to surrender in front of the Army but stayed stubborn to create a powerful judicial commission that the PTI proposed to probe the mass elections rigging of the 2013 general elections. And now as it seems all the stakes of the military are in keeping this phony government up and running since they had got the cake of 21st amendment passed by the National Assembly of Pakistan. Now if the government goes as part of the rigged elections, that amendment will also have to be made null&void since the people who approved are actually "Strangers in the house".

So now the dirty game is in place and I expect more anti-Khan events to happen in the coming days. I mean really ? that 21 cars motorcade was made shine of the News right after the orchestrated protest at the Army Public School.

My advice for Khan, keep it simple, concentrate on your rigging stance, try to be very cautious and keep your wife and politics apart so that the campaign to discredit does not get the fuel. One thing is for sure we have already had a soft-coup in Pakistan, one wrong move by the government and we may as well get a full fledged martial-law.


Friday, December 5, 2014

Making autopilot 'human'

A bit late to share a feature that I implemented in Autopilot. First, a lot of thanks to Chris Lee for having the patience for the code review.

Autopilot is a test running that we at Canonical use for the UI testing at the integration level. This nice tool is pretty fun and easy to use with some basic knowledge of python. After using it to write automation for more than a year, I finally ended up contributing to the test runner code itself.

One of the issues that was discovered while writing tests with autopilot that when it was doing multiple clicks continuously there was very little gap between the events. Imagine a test where the phone dials a long number in less than a second ? Not so human, is it ?

The solution that was agreed upon, was to introduce a reusable mechanism in autopilot where it would try to "humanize" the click/tap events. So now, when you dial a number or do some calculation in calculator app with autopilot, it will have at least a delay of 100 ms between those events. The below code sample would make it easy to understand.

    # lets assume 'pointer' is the input emulator for Mouse
    self.pointer.click_object(target_object1, time_between_events=2)
    # This click will happen after somewhat ~2 seconds.
    self.pointer.click_object(target_object2)

The feature is in trunk and will hopefully be released with the next autopilot version.