I could not click number on popup keyboard on appium, could anyone help me for this?


#1

I run my test, there is no error report in appium or eclipse but only my app failed. to execute the evaluate result.
here is my code:
package Practice;

import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;

public class clickAbout {

public static void main(String[] args) throws InterruptedException {
    
    //Set the Desired Capabilities
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("deviceName", "Android device");
    caps.setCapability("udid", "emulator-5554");//Give Device ID of your mobile phone
    caps.setCapability("platformName", "Android");
    caps.setCapability("platformVersion", "8.0.1");
    caps.setCapability("appPackage", "com.transcomputing.cali");
    caps.setCapability("appActivity", "com.transcomputing.cali.MainActivity");
    caps.setCapability("autoWebview", true);        
    caps.setCapability("showChromedriverLog",true);  
    caps.setCapability("unicodeKeyboard", true);
    
    //caps.setCapability("enablePerformanceLogging",true);
                
    try {
            AppiumDriver<MobileElement> driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"), caps);
                            
            //driver.findElement(By.cssSelector(".item-block")).click();
            driver.findElement(By.xpath("//*[@id=\'btn-about\']/div[1]/div")).click();
            driver.findElement(By.cssSelector("body > ion-app > ng-component > ion-nav > ng-component > ion-tabs > page-about > ion-header > ion-navbar > button")).click();
            driver.findElement(By.xpath("//*[@id=\'btn-resources\']/div[1]/div")).click();
            driver.findElement(By.xpath("//*[@id=\'tab-t0-0\']/ion-icon")).click();
            driver.findElement(By.xpath("//*[@id=\'btn-settings\']/div[1]/div")).click();
            driver.findElement(By.xpath("//*[@id=\'tab-t0-0\']/ion-icon")).click();
            driver.findElement(By.xpath("//*[@id=\'btn-evaluate\']/span")).click();
            
            driver.findElement(By.xpath("//*[@id=\'select-8-0\']/span")).click();
            JavascriptExecutor je = (JavascriptExecutor) driver;
           
            WebElement element = driver.findElement(By.xpath("/html/body/ion-app/ion-modal/div/ng-component/ion-content/div[2]/ion-list/button[29]/div[1]/div"));
           
            je.executeScript("arguments[0].scrollIntoView(true);",element);
          
            driver.findElement(By.xpath("/html/body/ion-app/ion-modal/div/ng-component/ion-content/div[2]/ion-list/button[29]/div[1]/div")).click();
          

          WebElement ele = driver.findElement(By.xpath("//*[@id=\'tabpanel-t0-1\']/page-evaluate-test-results/ion-content/div[2]/wrap-card-tablet/form/ion-list/ion-item-group[2]/ion-item[1]/div[1]/div/ion-input/input"));
          //((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", ele);
          
          JavascriptExecutor jse = (JavascriptExecutor)driver;
          jse.executeScript("arguments[0].value='2222';", ele);
          
          
          driver.findElement(By.xpath("//*[@id=\'tabpanel-t0-1\']/page-evaluate-test-results/ion-content/div[2]/wrap-card-tablet/form/ion-list/ion-item-group[4]/ion-item[1]/div[1]/div/div/div/div[2]/ion-segment/ion-segment-button[1]/div[1]")).click();
          driver.findElement(By.xpath("//*[@id=\'tabpanel-t0-1\']/page-evaluate-test-results/ion-content/div[2]/wrap-card-tablet/form/ion-list/ion-item-group[5]/ion-item[1]/div[1]/div/ion-select/div[1]")).click();
          
          
          Actions a=new Actions(driver);
        		a.moveToElement(driver.findElement(By.xpath("/html/body/ion-app/ion-popover/div/div[2]/div/ng-component/ion-list/ion-item[1]/div[1]/ion-radio"))).click().build().perform();
           driver.findElement(By.xpath("//*[@id=\'tabpanel-t0-1\']/page-evaluate-test-results/ion-content/div[2]/wrap-card-tablet/form/ion-grid/ion-row/ion-col[2]/button/span")).click();
        		
         
 
    } catch (MalformedURLException e) {
        System.out.println(e.getMessage());
    }
    
    
}

}
I can enter value into it by javascript method, but the result is not recognizeresult

if I use method as driver.findElement(By.xpath("/html/body/ion-app/ion-modal/div/ng-component/ion-content/div[2]/ion-list/button[29]/div[1]/div")).click();
the error report as unknown error: Element

is not clickable at point (159, 554). Other element would receive the click:
I am using java, appium 1.7.2

#2

I would prefer to use relative xpaths, instead of absolute. Please try to make an effective xpath then use.


#3


this is the keyboard, it is html5 keyboard, not accept sendkeys, has to click on keyboard.


#4

So, you have to click on any of the keys here ?

Please send me the screenshot of DOM


#5

do you mean this one?


#6

I am running into the same issue with numeric keyboard. Please share if there is a solution for this.