Harsha
June 16, 2022, 4:38pm
1
Hi All,
Can someone please suggest me how can I click on menu items present at the bottom layer of my app through automation. I am using appium webdriverio and this screen is a native screen.
I want to click on “More” option and I tried different ways to click on it but none was the success. I can able to click on other items present above on the same screen except this menu belt.
Attaching appium inspector results:
I can able to perform “
tap ” on
More button by clicking on tap icon of appium inspector but not able to achieve that through automation.
Also got the output of driver.getPageSource()
:
I tried below code:
const moreBtn = await browser.findElement(‘accessibility id’, ‘“More Tab 5 of 5”]’);
await driver.elementClick(moreBtn[‘ELEMENT’]);
Error:
Can someone please tell me how can I solve this?
a bit formatted your page source. you have different content-desc
: “Home
Tab 1 of 5”, “Orders
Tab 2 of 5” and so on.
example of code to find:
// Java
// by name
WebElement el_Home = driver.findElement(AppiumBy.androidUIAutomator("new UiSelector().descriptionMatches(\"Home.*\")"));
WebElement el_Orders = driver.findElement(AppiumBy.androidUIAutomator("new UiSelector().descriptionMatches(\"Orders.*\")"));
// by number
WebElement el_Home = driver.findElement(AppiumBy.androidUIAutomator("new UiSelector().descriptionMatches(\".*Tab 1 of 5\")"));
WebElement el_Orders = driver.findElement(AppiumBy.androidUIAutomator("new UiSelector().descriptionMatches(\".*Tab 2 of 5\")"));
Harsha
June 17, 2022, 8:26am
3
Thanks for giving me the direction. I solved by:
const xPath="//*[contains(@content-desc , ‘More’)]";
await driver.findElement(‘xpath’, xPath);
1 Like
Same issue not able to resolve …can you help me out