How to access popup windows in appium when running test

Hi, when running my test after filling input field and tapping the search button, system search the input value and if not find, give warning message as a popup but while test running the warning message not shown and hence i couldn’t tap the ‘OK’ button. How to access warning message?
r2


In r2.png warning message not shown when running test

Can you verify that in any way your search button is getting clicked while running automation test ?
I think the issue is that Search buttons id could be wrong or something.

while running test, log records like as below


I think that it taps the Search button

Agreed but it would be great if you can see the visible action on clicking Search button

What happens if you keep the textfield empty and click the Search button Manually?

When i keeping textfield empty and clicking the search button manually, it gives a warning like below
r4

Is this situation can be related about appium permissions for android?
In helpers,
helpers: {
Appium: {
app: “C:/Users/CC/Desktop/app.apk”,
platform: ‘Android’,
desiredCapabilities: {
appPackage: ‘blabla’,
appActivity: ‘blabla.MainActivity’,
deviceName: “Nexus_5_API_27”,
avd: “Nexus_5_API_27”,
avdLaunchTimeout: 60000,
platformVersion: “8.0”,
udid: “emulator-5554”,
noReset: false,
autoGrantPermissions: true,
newCommandTimeout: 500,
automationName: “uiautomator2”,
chromeOptions: {
args: [’–disable-popup-blocking’]
}
},

    },
    custom_helper: {
        require: "./helpers/custom_helper.js"
    }

},

i used “autoGrantPermissions: true” but never comes popup window after tapping Search button

Yes, it can be because autoGrantPermission clicks Popup button very quickly so that could be a reason for not finding the Element “OK”

Is there a way to slow down to autoGrantPermission click process?

I dont think there is an option for it.

What appium says :
Have Appium automatically determine which permissions your app requires and grant them to the app on install. Defaults to false. If noReset is true, this capability doesn’t work.

I have a question

Does your keyboard gets dismissed before clicking Search button ?

If not then try to close the keyboard and then Click Search button.

I hide the keyboard, this times it gives an “Touch actions like “tap” need at least some kind of position information like “element”, “x” or “y” options, you’ve none given.” error. But popup windows not appear again

Can you show me the code you are executing ?

Feature(‘Login’);

Scenario(‘test something’, async (I) => {

I.wait(3);
I.seeElement("//android.webkit.WebView[contains(@content-desc,'Product List')]");    
I.tap("//android.widget.Button[contains(@content-desc,'Search Product')]");
I.seeElement("//android.widget.Button[contains(@content-desc,'Manual Search')]");
I.tap("//android.widget.Button[contains(@content-desc,'Manual Search')]");
I.hideDeviceKeyboard();
I.fillField("//android.widget.EditText", "123456789");
I.tap("//android.widget.Button[contains(@content-desc,'Search')]");
await I.tap("//android.widget.Button[contains(@content-desc,'OK')]");   
I.wait(3);

});

can you change order to

I.tap(“//android.widget.Button[contains(@content-desc,‘Search’)]”);
I.wait(5);
await I.tap(“//android.widget.Button[contains(@content-desc,‘OK’)]”);

one more thing :

Is there any way that you can check the Search button element is present or not?

I changed the order but it gives the same error again

But now you are getting a popup but not able to click OK button…m i correct?

No unfortunately, popup never appear, just add this picture to show the viewer, may be help. It manually works but when running automatically not appear

Thanks your interest. I’ve dealing with for one weeks but not get a solution

Can you share the appium version and config you are using
io.client
Selenium jar?

My project is a maven project
Appium version is: 1.10.1
io.client: appium?, codeceptjs?
selenium: 3.141.59

codecept.conf.js is
const selenium = require(‘selenium-standalone’);
const appiumController = require(‘appium-controller’);

exports.config = {
services: [‘selenium-standalone’],
tests: ‘./tests/*_test.js’,
output: ‘./output/errorscreenshots’,
helpers: {
Appium: {
app: “C:/Users/CC/Desktop/app.apk”,
platform: ‘Android’,
desiredCapabilities: {
appPackage: ‘blabla’,
appWaitActivity: ‘blabla.MainActivity’,
deviceName: “Nexus_5_API_27”,
avd: “Nexus_5_API_27”,
avdLaunchTimeout: 60000,
platformVersion: “8.0”,
udid: “emulator-5554”,
noReset: false,
autoGrantPermissions: true,
newCommandTimeout: 500,
automationName: “uiautomator2”,
chromeOptions: {
args: [’–disable-popup-blocking’]
}
},

    },
    custom_helper: {
        require: "./helpers/custom_helper.js"
    }

},
bootstrap: (done) => {
    selenium.start((err, child) => {
        if (err) {
            throw err;
        }
        console.log('Selenium started'); // eslint-disable-line
        selenium.__child = child; // eslint-disable-line
        done();
    });
    appiumController.startAppium((err, child) => {
        if (err) {
            throw err;
        }
        console.log('Appium started');
        appiumController.__child = child;
        done();
    });
},   
include: {
    I: "./steps_file.js",

    testPage: "./pages/TestPage.js"
},
plugins: {
    allure: {
        enabled: "false",
        outputDir: "./output/errorscreenshots"
    },
    autoDelay: {
        enabled: true,
        methods: ['click', 'tap', 'pressKey', 'fillField'],
        delayBefore: 100,
        delayAfter: 300
    }
},
mocha: {},    
name: "mobile-codeceptjs"

};