Skip to main content

Posts

Showing posts from 2014

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

Wait!!! 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 seconds Page Load Timeouts - When you set this wait, webdriver would wait for this amount of time to declare page load timeouts Syntax -  driver . manage (). timeouts (). pageLoadTimeout ( 100 , SECONDS ); Example - Let's say we ar

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 function Let's say your data is this Column A Siri Sekhar Sahan Sahiti Sahana Siri Sekhar Sekhar 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 Table In 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\android-2.3_r01-linux.zip (Access is denied) Done. Nothing installed Then 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 Phone Enable USB Debugging on your Phone Enable USB Debugging on the Chrome  browser of your phone On Windows 7 Install the “ADB PLugin” extension on Chrome browser Install the phone drivers needed as per the phone you want to debug Connect the phone to windows Open “ADB Plugin” and start debugging!!!   Important Links http://www.androidcentral.com/how-enable-developer-settings-android-42 http://devtoolsecrets.com/secret/mobile-using-developer-tools-on-android.html https://developers.google.com/chrome-developer-tools/docs/remote-debugging   Hope this helps!

Windows PowerShell Common Commands

  Some common commands on PowerShell Change a Directory DOS: cd PowerShell: Set-Location List Files in a Directory DOS: dir PowerShell: Get-ChildItem Rename a File: DOS: rename PowerShell: Rename-Item To 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-Alias This 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 - http://www.howtogeek.com/163127/how-powershell-differs-from-the-windows-command-prompt/ Please 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 or 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 tar.bz 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 so Open Terminal Type in “ sudo restart ” to restart the system Sometimes you may get the error “command restart not found” if you get this error then try the commands using sudo /sbin/restart or sudo /sbin/shutdown –r now   Get more help on shutdown command using man shutdown