Wednesday, November 22, 2017

adb devices not showing the Android device

Connect your android device
Go to Settings->About Phone/Device -> Tap on the build number 7 times
you will go to developer mode.
Just above the option About device you will find "Developer Options" setting. tap on that.
Enable USB debugging.
It would ask for a confirmation of RSA fingerprint. Click on Ok.

Now go to terminal/command prompt and run the command "adb devices"
Your device will be listed with device id.

In the android capabilities in your code you can use the above device id as udid 
Ex: udid=c55c70af04399e58



Tuesday, November 7, 2017

Enabling Keyboard input in Android Emulator

Open Android Studio.
Open AVD Manager.
Click on Edit for the device which you want to have keyboard input.
Click on Show Advanced Settings. 
At last there is a option called "Enable Keyboard Input"


Enable that.. Save and start the emulator. Now you can use your keyboard with emulator.


Monday, November 6, 2017

Emulator Proxy Settings - Android Studio

With the emulator open, click More , and then click Settings and Proxy. From here, you can define your own HTTP proxy settings.

Refer to the below Image.




Give the proxy URl and port number and also if authorization required give those details. apply.

now open browser in emulator and check.

It worked for me. Hope it will help others too :)

Thursday, November 2, 2017

Steps to Automate LinkedIn Android app[Package+activity+capabilities]

1) install Appium + Node

2) Install Android Studio as well and create a virtual device on that i have created with name : Nexus_5X_API_25_1

3) Download LinkedIn.apk file from below link.

4) Now For automating any android app we need to know the package and activity names.
So Lets find them.

For this set your PATH variable to point to below directories.

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/build-tools/26.0.2

above version can be anything in my case it is 26.0.2

after setting the above path variables run the below command.

aapt dump badging “<Path to LinkedIn.apk>” 

Output of above command will contain below 2 values.

package: name='com.linkedin.android'
launchable-activity: name=‘com.linkedin.android.authenticator.LaunchActivity'

5) So we got the package name and activity name too. Now we should frame the desired capabilities section. Like this(In my machine)

{
  "platformName": "Android",
  "deviceName": "Android Emulator",
  "app": "/Users/sriramkukkadapu/Downloads/LinkedIn.apk",
  "automationName": "Appium",
  "platformVersion": "7.1.1",
  "appPackage": "com.linkedin.android",
  "appActivity": "com.linkedin.android.authenticator.LaunchActivity",
  "avd": "Nexus_5X_API_25_1”
}


6) Now start appium with above capabilities and you can see it will open the app :)

Assuming my appium/node server is running on url : http://127.0.0.1:4723/wd/hub
You can check the status of the server with this url http://127.0.0.1:4723/wd/hub/status

Note: IP and the port number values would be the one which we give, when we start the node/appium server

Code:


public class AndroidDriverEx {
public static void main(String args[]) throws IOException, InterruptedException
{
    WebDriver driver=null;
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("deviceName","Android Emulator");
    capabilities.setCapability("platformName","Android");
    capabilities.setCapability("app", "/Users/sriramkukkadapu/Downloads/LinkedIn.apk");
    capabilities.setCapability("automationName","Appium");
    capabilities.setCapability("platformVersion","7.1.1");
    capabilities.setCapability("appPackage","com.linkedin.android");
    capabilities.setCapability("appActivity","com.linkedin.android.authenticator.LaunchActivity");
    capabilities.setCapability("avd","Nexus_5X_API_25_1");
    driver=new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    Thread.sleep(3000);
    driver.quit();
}

Now we are good to go and automate all the actions which you wanted to automate.


How to avoid our mails going to spam - FIx the issue in 3 simple steps

If you see our emails from (info@jobcurator.in) are going to spam, fix it using below steps. Note: Try this in desktop/laptop 1) Go to any...