@Zuzeac
Thank you, for your reply.
May I know Which class should I mentioned instead of BaseSetup in the below line:
WebDriverWait wait = new WebDriverWait(driver, BaseSetup.EXPLICIT_WAIT_TIME, 500);
I have tried the different way and I am getting error I have mentioned the code as well as attach the screenshot of the error:
import java.net.MalformedURLException;
import java.net.SocketException;
import java.net.URL;
import java.util.Scanner;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;
import com.convert.Ntow;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
public class Calling {
AndroidDriver dr;
@Test
public void call() throws MalformedURLException, WebDriverException, SocketException, InterruptedException, NullPointerException
{
WebDriverWait wait= new WebDriverWait(dr,20);
DesiredCapabilities cp= new DesiredCapabilities();
cp.setCapability("deviceName", "Moto C Plus");
cp.setCapability("platformVersion", "7.0");
cp.setCapability("platformName", "Android");
cp.setCapability("appPackage", "com.motorola.launcher3");
cp.setCapability("appActivity", "com.android.launcher3.GoogleNowPanel");
dr = new AndroidDriver (new URL("http://127.0.0.1:4723/wd/hub"),cp);
dr.findElementByAccessibilityId("Phone").click();
dr.findElement(By.id("com.android.dialer:id/floating_action_button")).click();
Ntow c = new Ntow();
Scanner sc = new Scanner(System.in);
System.out.print("Enter Mobile Number");
int i; int arr[] = new int[10];
int brr[]=new int[10];
String[] srr= new String[10];
for(i=0;i<10;i++)
{
arr[i]= sc.nextInt();
}
for(int m=1;m<=5;m++)
{
for(int k:arr)
{
WebElement dl= wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("com.android.dialer:id/"+c.Convert(k)+"")));
dl.click();
}
dr.findElement(By.id("com.android.dialer:id/dialpad_floating_action_button")).click();
Thread.sleep(10000);
dr.findElement(By.id("com.android.dialer:id/floating_end_call_action_button")).click();
}
}
}
