Skip to main content

Posts

Take screenshot using adb

Many times, when I am working with the Android devices, I just want to keep using the command line and be able to take the screenshots too.

Yes, we can do that!
Here is how:
Start ADB server if its not already running. To check, type in adb devices on the command line -- if its not started it should start now and give you the device id for the device you have connectedNow type in the following commands to capture a screen
adb shell screencap -p /sdcard/Pictures/Screenshots/screen.png adb pull /sdcard/Pictures/Screenshots/screen.png adb shell rm /sdcard/Pictures/Screenshots/screen.png
Recent posts

Ubuntu: "Unlock login keyring" message "the password you use to log in your computer no longer matches that of your login keyring"

Resetting all the keyring passwords: 

Navigate to Places > Home. Press ctrlh to view "hidden files". Navigate to .gnome2 > keyrings and deletelogin.keyring


Using the same keyring (resetting keyring password but keeping old passwords in keyring):


1) Make a backup of the keyring cd ~/.local/share/keyrings/ cp login.keyring login.keyring.backup and after that delete login.keyring file rm ~/.local/share/keyrings/login.keyring 2) Create a new keyring file from Gnome Keyring with the name "login" 3) Replace the new keyring file with the backup of the old keyring file cd ~/.local/share/keyrings/ mv login.keyring.backup login.keyring Note: before Ubuntu 12.10 the path to the keyrings folder was~/.gnome2/keyrings/instead of ~/.local/share/keyrings/

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 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
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 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\android-2.3_r01-linux.zip (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