HOWTO: Launch IPhone Simulator with Selenium

Apr
30

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!

Posted By dimaj read more

HOWTO: Split a string using split

Apr
25

Recently I was faced with a problem... I had an output of a 'ps' command and I needed to get the pid out. I know that you can get it out using awk and grep, but I could not get it to work from within my Java program. So, I had my output in a string array, where each line was a separate process. If you have seen an output of the ps command, you know that there is non-constant number of spaces between each field. So, to overcome that, I had to resort to regular expressions.

Here's the code that worked for me.

Posted By dimaj read more

HOWTO: recursive scp without following symbolic links

Mar
06

Recently I've acquired a new computer to be used as a file server. I have decided to move away from FreeNAS and switch over to a Ubuntu based desktop. Since I was using Software RAID on FreeNAS, I figured that it would be safer and easier to just copy files from FreeNAS to my new Ubuntu-based NAS over network via SCP. The problem that I've encountered with scp is that if I do a recursive copy, all the links that I've created will be followed and copied over.

Here's a solution I found that I think is great:

Posted By dimaj read more

HOWTO: Compare 2 dates in different formats in TestComplete

Nov
15

Suppose you have two date time strings in different formats and you need to compare if they are the same. Here's a function the code that will do this task for you.
NOTE: This code assumes that your dates are in the following formats: 12/31/2011 12:00:00 AM and 31-December-2011-00:00:00

To tackle this task, we're going to parse above mentioned date string and get number of milliseconds since January 1, 1970. Once we have our date in milliseconds, compare the two numbers and see if dates are same or different.

Posted By dimaj read more

How to close message in preview pane in GMail

Sep
12

Are you a GMail addict like I am? Do you always keep your inbox open in one of your browser's tab? Do you like to experiment with new plugins and features that Google has to offer? If you do and if you've enabled a preview pane you might have noticed that after you read an e-mail, it stays open. I don't know about you, but that really irritates me. Today, thanks to this forum thread, I found a way to keep the preview pane empty!

Posted By dimaj read more

How to round a number to a specific number of decimal places in JavaScript / JScript

Sep
02

If you will look at the documentation of Math.round() method, you'll see that it takes only 1 argument, which is the number that you want to round. The rounding method is going to round your number to the closes integer. If this doesn't sit well with you, you can use the function below to round any number to any decimal places.

Posted By dimaj read more

HOWTO: Automatically add a row to a spreadsheet in Google Docs

Jul
13

Have you ever found that you had to update an excel spreadsheet with the same information every month or every week? Are you using Google Docs for that spreadsheet? If you are, you are in luck since this tutorial will show you exactly how to do that.

First, you'll need to have the following squared away:

  • A Google account. So that you could access Google Docs
  • A spreadsheet that will hold the information and will get auto-populated on regular basis
  • Now that you got all the "pre-requisites" squared away, let's actually get to the good part!

    Posted By dimaj read more

    How to Query ClearQuest database using SQL

    Jul
    12

    The place I work at uses IBM's ClearQuest for defect tracking. Since right now I'm working on automating our software, I'm constantly trying to find new ways of minimizing user interaction before, during, and after script execution. My latest side project was writing some functions that will interact with ClearQuest's database, which is Oracle, and pull out defect numbers.

    Posted By dimaj read more

    HOWTO: Force GC.Collect for an application under test from TestComplete

    Apr
    21

    So, recently I've been asked to measure how much memory our application is using. The requirements were as follows:
    1) Get current memory
    2) Do somethings with an app
    3) Get new memory reading

    Seems pretty easy, right? Just go to a task manager and write down current memory reading. Then after some go back to our task manager and get new reading. Subtract one from the other and get your delta!

    Posted By dimaj read more

    HOWTO: Track test case progress in TestComplete

    Apr
    11

    Right now I'm working on automating test procedures that test the software we're working on. As always, at the end of our automation we need to provide a detailed report with results for every step of the procedure. Since our procedures have two types of steps, Action Step and Verification Step, we need to provide different pass/fail messages. So, to make this happen, I've decided to use the following approach.

    Posted By dimaj read more

    Pages

    Subscribe to dimaj.net RSS