Skip to main content


Showing posts from 2014

Can't wait to wait -- Webdriver Waits!!


These four letters can drive you crazy if you are having a bad day using Webdriver...

Thus if you are reading this article you are already in the middle of one bad bad day...thus I'll cut the crap and go directly into the ways you can add waits using webdriver:

Type 1 - Using driver.manager.timeouts()Implicit Waits - When you set this wait, webdriver would wait for this amount of time before failing any command.Syntax - driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);Example - Webdriver is looking to find an element using an xpath and its not able to find it, webdriver waits for 10 seconds before trying to find the element and thus failing if it still can't find the element after 10 secondsPage Load Timeouts - When you set this wait, webdriver would wait for this amount of time to declare page load timeoutsSyntax - driver.manage().timeouts().pageLoadTimeout(100, SECONDS);Example - Let's say we are navigating from one page to another, when we reach the n…

MS Excel - Find Duplicates in a Coloumn

Lets say you have a column full of data in your excel and you want to find out the duplicates in it:
Method 1 - Using Countif functionLet's say your data is this

Column A

Now in Column B enter the formula in the first cell
=CountIF($A$1:$A$8, A1)

Then sort the data by Column B and you will know which data is repeated

Method 2 - Using Pivot TableIn Excel 2013, go to Insert --> Pivot Table
When asked to select Table or Range, select the Column A data

Now when the pivot table fields are shown select the Column A and drag it to "Row Labels" and "Values" - Set "Values" to Count

This will give you the count of each of the element thus enabling you to find the duplicates.

Access Denied Error while installing from Android SDK manager

When you are trying to install API or tools from the android SDK manager and you are getting error like Downloading SDK Platform Android 2.3, API 9, revision 1 File not found: C:\Program Files (x86)\Android\android-sdk-windows\temp\ (Access is denied)Done. Nothing installedThen you need to close the SDK manager Go to the android/sdk/tools folder Right click on the android.bat file and “Run as administrator” You need to run as an administrator to install android tools or api

Debug an Android Phone on Windows

To debug an android phone on windows you need to follow these steps: On the PhoneEnable USB Debugging on your PhoneEnable USB Debugging on the Chrome  browser of your phoneOn Windows 7Install the “ADB PLugin” extension on Chrome browserInstall the phone drivers needed as per the phone you want to debugConnect the phone to windowsOpen “ADB Plugin” and start debugging!!!Important Links this helps!

Windows PowerShell Common Commands

Some common commands on PowerShell Change a Directory DOS: cdPowerShell: Set-LocationList Files in a Directory DOS: dirPowerShell: Get-ChildItemRename a File: DOS: renamePowerShell: Rename-ItemTo see if a DOS command has an alias, you can use the Get-Alias cmdlet. For example, Get-Alias cd shows you that cd is actually running the Set-Location cmdlet. So instead of remembering all the powershell equivalents, just remember the alias command which is Get-AliasThis way just log into PowerShell and type the command Get-Alias <command line command> and you’ll get the equivalent powerShell command of it! I’ve shamelessly copied the content from this website - visit the main site for more information on PowerShell… More Power to you

How to Unpack a tar file on Windows?

On Windows:
You can download a simple command line tool to do this.
You can download the tool from here Usage can be found on the website but pasting it here too for convenience: C:\>TarTool.exe
Usage :
C:\>TarTool.exe sourceFile destinationDirectory
C:\>TarTool.exe D:\sample.tar.gz ./
C:\>TarTool.exe sample.tgz temp
C:\>TarTool.exe -x sample.tar temp
TarTool 2.0 Beta supports bzip2 decompression for files with extensions like tar.bz2 and .bz2.
TarTool -xj sample.tar.bz2 temp
TarTool -j sample.bz2
Download TarTool 2.0 Beta from here
Unpack a .txz file on Windows
Use the 7zip tool to unpack a .txz file on windows

On Linux:
You can use the bzip2 and tar combined to do this…
for ex: bzip2 –cd <tar.bz_fileName> | tar –xvf -
This will unpack the contents of the file

Happy Un-Tar-ing

Control Linux Box using Terminal

You can shutdown, restart a linux box from Terminal. You can use the following commands to do soOpen Terminal Type in sudo restartto restart the systemSometimes you may get the error “command restart not found” if you get this error then try the commands usingsudo /sbin/restart or sudo /sbin/shutdown –r nowGet more help on shutdown command using man shutdown