RAMESH NEKKANTI
RAMESH NEKKANTI

Reputation: 11

In Appium inspector, FOr IOS App - not able to inspect "Hamburger menu options"

In Appium inspector, For IOS App - not able to inspect/not recognized "Hamburger menu options". When I tried to inspect the element I see background screen elements ID's but not from the Hamburger menu.

Can any one suggest, is it issue with Appium versions or web driver agent issue Appium 1.22.3

Appium-python-client - 2.10.1 XCODE Version 15.3 (15E204a) Appium-inspector - app version 2023.12.2, Electron: 13.6.9 Node.js: 14.16.0 pytest 7.3.1 python 3.9

iPhone 15 plus (os 17.2)

waiting for the suggestions. Thanks in advance.

in IOS device with the mobile app.

enter image description here

Upvotes: 0

Views: 135

Answers (1)

Ara Galstyan
Ara Galstyan

Reputation: 556

I faced a similar issue where elements were not selectable in the Appium Inspector. I asked the developer to add accessibility IDs to each menu element. Despite these elements not being selectable in the Appium Inspector, you can still use these accessibility IDs in your code. Appium will be able to interact with the elements successfully.

Here’s how you can verify that your elements have accessibility IDs:

Inspector

How to Generate Hamburger Menu Items with Accessibility IDs in a React Native App

The developer can add accessibility IDs to each menu element like this:

const BurgerItem = ({ onPress, text, icon, ...props }: BurgerItemProps) => {
  const prefix = text.replace(/ +/g, "").toLocaleLowerCase();
  return (
    <TouchableOpacity style={styles.menuButton} onPress={onPress} testID={`item-${prefix}`}>
      <Icon name={icon} testID={`${prefix}-icon`} {...props} />
      <Text style={styles.menuText} testID={`${prefix}-text`}>{text}</Text>
    </TouchableOpacity>
  );
};

These testID props serve as accessibility IDs that Appium can use to interact with these elements in your tests.

Upvotes: 0

Related Questions