facebookarchive / WebDriverAgent

A WebDriver server for iOS that runs inside the Simulator.
Other
4.15k stars 1.35k forks source link

Appium doesn't find the element in iOS modal window #854

Open DiogoMiranda opened 6 years ago

DiogoMiranda commented 6 years ago

I am having an issue while automating iOS app via appium. The problem I am facing is our app have some modal window. My suspicion is, Appium doesn't find any element in iOS modal window. If some one can suggest on how to switch to interact with that modal window, it would be really helpful. I send a print of one window, what is possible seen Accessibility Inspector dont find a elements, for exemplo button, or text on window.

Appium v1.7.1 platformName = "iOS" platformVersion = "11.2" deviceName = "iPhone 6" Xcode = “9.2”

screen shot 2018-01-20 at 10 10 32 am screen shot 2018-01-20 at 10 10 09 am screen shot 2018-01-20 at 2 51 08 pm screen shot 2018-01-20 at 10 09 24 am screen shot 2018-01-20 at 9 51 10 am screen shot 2018-01-20 at 9 43 42 am
marekcirkos commented 6 years ago

It this a webview by any chance?

marekcirkos commented 6 years ago

Can you provide sample app ?

DiogoMiranda commented 6 years ago

It this a webview by any chance? No, is a native iOS app

Can you provide sample app ? Yes, I will prepare

marekcirkos commented 6 years ago

I think I don't full understand the problem here. general_button_close is being reported, so what is missing then?

DiogoMiranda commented 6 years ago

The problem, doesn't have only the general_button_close, but there are others elements what Appium doesn't identify. For exemplo, button "Continuar"

marekcirkos commented 6 years ago

@DiogoMiranda I am sorry if I ask trivial / obvious question. Do you expose those missing elements with accessibility identifiers? Does Voice over see those elements?

DiogoMiranda commented 6 years ago

Hi @marekcirkos, i did a little study for can understand better, and problem is not necessarily a modal window, but a some configurations on xcode. I will continue studying and i return for show detail in other moment.

DiogoMiranda commented 6 years ago

@marekcirkos, I developed a simple app, for show some configurations what i am having problem. You can see in this repository: simple iOS app

zcmgyu commented 6 years ago

I also have same problem on just 2 specified screen. Application was developed by React Native.

abhivaikar commented 6 years ago

I have a similar problem where a close button on a modal popup does not show up as a UI object in Appium Inspector. Developers have added accessibility id to the element but that element just doesn't show up in the inspector UI hierarchy. See below screenshot. The button highlighted with yellow circle does not show up in inspector hierarchy. So I can't find it.

image

Appium: 1.8.0 Platform name: iOS Platform Version: 11.2 automationName: XCUITest device: iPhone 6s Simulator

DiogoMiranda commented 6 years ago

Some news, can you help ? @marekcirkos

benprebble commented 6 years ago

@DiogoMiranda what news do you have? We are experiencing the same issue. React-native app.

DiogoMiranda commented 6 years ago

@benprebble My problem is this of post. Is a native app ios, and appium dont find the elements in some screens, despite the element to have a id.

luisxiaomai commented 6 years ago

same issue, need help

DiogoMiranda commented 6 years ago

can you help ? @marekcirkos @luisxiaomai

rcuyugan commented 6 years ago

Same issue here on a React Native app with iOS, appium 1.8.1. Help!

meetravi commented 5 years ago

+1 Same issue, the element doesn't show up on the appium inspector 1.8.0 and 1.9.0.

YuriWhil commented 5 years ago

Same problem, on a React Native app with iOS. Appium 1.9.1

fdPoornima commented 5 years ago

+1 Same issue, 1.9.1 react native app. "Interactions are not available for this element"

ChangLingSg commented 5 years ago

Same issue. The element cannot be detect from both inspector and code.

abhijithpp commented 5 years ago

Make sure your iOS developer enabled the "Accessibility" and set an acceptability identifier to each UI element.

ghost commented 5 years ago

You would be able to expose any React custom/native component by attaching a testID attribute in code so Accessibility Inspector (Xcode) can pick it up.

image

Everything set to an ID can be easily interacted using Appium's findElementByAccessibilityId. However, Appium is unable to see the above custom Popover Component even when exposed in XCode. Is this an unimplemented feature as of yet?

Working with Native App: react native Appium: 6.1.0 IOS Simulator

ghost commented 5 years ago

Hi @dpgraham, would you know anyone who can help with this?

doriandres commented 5 years ago

I need help

doriandres commented 5 years ago

I NEED THE ANSWEEEEEEEER!!!!!!! PLISSSSSSSS

AlonzoRicardo commented 5 years ago

Same problem, at the moment im just selecting the element by text that it contains, but isn't as reliable, fails some times.

kulswapnil commented 5 years ago

Refresh the appium inspector for that page and try again.

ashokseervidev commented 5 years ago

i did modification in my code and it works. My testing able to detect views inside model.

setting accessible={false} on outer most layer makes child views accessible.

`  render() {
    return (
      <Modal
          visible={this.props.isMenuVisible}
          transparent
          animationType={'slide'}
      >
        <TouchableOpacity
            style={[styles.container, { backgroundColor: this.state.backgroundColor }]}
            onPress={this.onAction}
            accessible={false}
        >
          <View style={styles.menuItems}>
            <MenuItemsList onAction={this.onAction} {...this.props} />
          </View>
          {this.props.showLoader && <Loader/>}
        </TouchableOpacity>
      </Modal>
    );
  }`

@

DiogoMiranda commented 5 years ago

Hi everyone. In my project the problem was solved changing for view code some screens what was created initially how Storyboard (native iOS app)