@Massanori_Takaki can you please help me out of this
i tried your your suggested code but it is not working for wait
package defaultproject;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
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 bsh.Capabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
public class watsaap {
private AppiumDriver dr;
private WebDriverWait wDriver;
@BeforeMethod
public void setUp() throws MalformedURLException {
File file = new File("/home/Rupel/workspace/myappium/servetoum/CRM_13_july.apk");
DesiredCapabilities caps = new DesiredCapabilities();
dr = new AndroidDriver(new URL("http://0.0.0.0:4723/wd/hub"), caps);
// dr = new AndroidDriver<MobileElement>(url, getCapas());
caps.setCapability("deviceName", "Android");
caps.setCapability("app", file.getAbsolutePath());
caps.setCapability("appPackage", "com.servitiumcrm.technician");
caps.setCapability("app Activity", ".activity.RegistrationActivity");
wDriver = new WebDriverWait(dr, 65);
}
@Test
public void test() {
find("et_company_code").sendKeys(" 30001");
find("et_mobile_no").sendKeys("9540202589");
find("tv_submit").click();
find("et_company_code").sendKeys("123456");
find("tv_submit").click();
find("et_company_code").sendKeys("1234");
find("et_mobile_no").sendKeys("1234");
find("tv_submit").click();
gone("By.id");//Look for the locator of the dialog displayed on the screenshot
}
public WebElement find(String id) {
return wDriver.until(ExpectedConditions.presenceOfElementLocated(By.id(id)));
}
public boolean gone(String id) {
return wDriver.until(ExpectedConditions.invisibilityOfElementLocated(By.id(id)));
}
}