This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
2 / 2
Dec 2018

I have been trying since long to click on the image from gallery but my driver just executes the code but nothing happens on the screen and than it fails while locating element on next page.

Following is the Image:

I have been trying since long to click on the image from gallery but my driver just executes the code but nothing happens on the screen and than it fails while locating element on next page.

Scenario is:

Note: I am automating Ionic App which takes you to Native screen.

  1. Select the first image
  2. And than OK button will be enabled
  3. Than click on OK button

Following is My code:

        app.tap("sell_add_photo");
        waitElement.until(ExpectedConditions.elementToBeClickable(By.xpath(field.get("sell_photo_choose_photo"))));
        app.tap("sell_photo_choose_photo");

        Thread.sleep(5000);
        Set<String> contextNames2 = driver.getContextHandles();
        for (String contextName : contextNames2) {
            if (contextName.contains("NATIVE")) {
                System.out.println(contextName);
                driver.context(contextName);
                Thread.sleep(5000);
            }
        }

        driver.findElement(By.xpath("//android.widget.GridView//android.widget.ImageView[1]")).click();
        driver.findElement(By.xpath("//android.widget.FrameLayout[2]//android.widget.TextView[1]")).click();

        waitElement.until(ExpectedConditions.elementToBeClickable(By.xpath(field.get("sell_image_listing"))));

In appium server it shows, It has clicked image and Okay button and start searching for next element. But in actually it does not click on any of the element on screen.

  • created

    Feb '17
  • last reply

    Dec '18
  • 1

    reply

  • 723

    views

  • 2

    users

  • 1

    like

1 year later