Tuesday, 23 June 2015

Appium Example Calling Number

Appium Example Calling Number


Video will show hou you can call any number from your mobile using Appium and Selenium WebDriver





import java.net.MalformedURLException;
import java.net.URL;

import io.appium.java_client.android.AndroidDriver;

import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;


public class CallingNumber {

AndroidDriver dr;
@Test
public void call() throws MalformedURLException{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "Moto G");
capabilities.setCapability("platformVersion", "5.0.2");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("appPackage", "com.android.dialer");
capabilities.setCapability("appActivity", "com.android.dialer.DialtactsActivity");

dr = new AndroidDriver(new URL("http://192.168.1.3:4723/wd/hub"), capabilities);
dr.findElement(By.id("com.android.dialer:id/floating_action_button")).click();
//Dial a number
dr.findElement(By.id("com.android.dialer:id/one")).click();
dr.findElement(By.id("com.android.dialer:id/one")).click();
dr.findElement(By.id("com.android.dialer:id/one")).click();
//Dialing a number
dr.findElement(By.id("com.android.dialer:id/dialpad_floating_action_button")).click();
}
}




14 comments:

  1. Very good tutorials Please provide some tutorial videos to automate web view of an app in mobile device as well in chrome browser.

    ReplyDelete
  2. Hello Rekha, please find videos of web app https://www.udemy.com/appium-selenium-for-mobile-automation-testing/?couponCode=BlogCoupon

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Thank you it was a interesting post Appium

    ReplyDelete
  5. Is there a way to check which number got dialed?

    ReplyDelete
  6. Best place to learn Appium Android IOS Automation Testing Training in Chennai

    Go for Appium training in chennai for real time mobile automation testing training with real time project support.
    Mr. Vishwa is a best person who can teach and develop people in Appium and Selenium,Coded UI Automation Tools with real time scenarios.

    ReplyDelete
  7. Thanks for sharing this Information, Got to learn new things from your Blog on Appium.
    Appium training in chennai

    ReplyDelete
  8. Thanks for sharing this Information, Got to learn new things from your Blog on Appium.
    Talk to eight one two two two four one two eight six.
    Appium training in chennai

    ReplyDelete
  9. Hey guys, I joined with them for Appium training and going on wonderful.
    Feeling confident and sure to be placed well.
    Talk to eight one two two two four one two eight six.
    Appium training in chennai

    ReplyDelete
  10. We provide the Advance Level Appium training in Chennai with real time Scenarios. We are the best training institute in Chennai providing real time training. Here the trainers provide the practical classes with real time scenarios. call@ 8122241286
    Appium training in chennai

    ReplyDelete
  11. I joined with them for selenium training and its going on good.
    Hope I will be placed in a good company.
    They are cool team so far in chennai .
    Call them at 8122241286.
    www.thecreatingexperts.com
    selenium training in chennai

    ReplyDelete
  12. I was looking for Appium training in Chennai and got a link,it was the CREATING EXPERTS awesome training with real-time scenarios,got a good exposure to learn things best.If you are looking for one click the link below and contact 8122241286.

    http://thecreatingexperts.com/appium-training-in-chennai/

    ReplyDelete
  13. I tried your code, but getting NosuchElementException for dialling numbers

    ReplyDelete
  14. Thanks for sharing this Information, Got to learn new things from your Blog on Appium.

    Basically we are not a related from this topic. We are online shooing portal which provide only genuine products in India.

    ReplyDelete