0

We're trying to automate one of our Test cases on iOS (iPad) with appium-java client 8.

The test step is like below:

  1. Fetch element from TextField
  2. Click on that textField
  3. Clear the existing value and enter the new value

Test Result:

  1. We're able to fetch the value from the TextField
  2. Click action is successful but the actual interaction is not working. Due to which the sendkeys also not working

Note: The above scenario was working fine with approach 1 with TestProject. Now we've migrated the framework to appium. After that only it's failing few scenarios

Please review the attached DOMAppium Inspector- Actual Element

Tried Approaches 1. Approach 1

 {
    element.getAttribute("value");
    element.click();
    element.sendkeys("newvalue");
    }

-> Test Result:

  1. We're able to fetch the value from the TextField
  2. Click action is successful but the actual interaction is not working. Due to which the sendkeys also not working

2. Actions Class

 {
    Actions action = new Actions(appiumDriver);
    WebElement element = appiumDriver.findElement(byLocator);
    element.getAttribute("value");
    action.moveToElement(element).click().perform();
    action.moveToElement(element).sendKeys(Keys.chord(Keys.CONTROL, "a")).perform();
    element.clear();
    element.sendKeys(""+text);
    appiumDriver.hideKeyboard(); 
    }

Test Result:

  1. We're able to fetch the value from the TextField
  2. Click action is successful but the actual interaction is not working. Due to which the sendkeys also not working

3. With W3C action

{
    PointerInput FINGER = new PointerInput(PointerInput.Kind.TOUCH, "finger");
    Sequence tap = new Sequence(FINGER, 1)
        .addAction(FINGER.createPointerMove(Duration.ofMillis(0),PointerInput.Origin.viewport(),    (element.getRect().x + (element.getSize().width/2)), element.getRect().y))
        .addAction(FINGER.createPointerDown(0))
        .addAction(new Pause(FINGER, Duration.ofMillis(200)))
        .addAction(FINGER.createPointerUp(0));
    appiumDriver.perform(Arrays.asList(tap)); 
    }

Test Result:

  1. We're able to fetch the value from the TextField
  2. Click action is working fine. However it's clicking on different location. Same thing happening when we try to find element in appium inspector. The locator is correct but still the coordinates are different one.

Find element with xpath-Highlighing coordinates

Halbirya
  • 1
  • 1

0 Answers0