Webelements don't contain text properties when it's a Web Hybrid app with ionic
See original GitHub issueWe are trying to test a Web Hybrid app made with ionic
When using Appium inspector ( the result in my tests with AppiumDriver is the same ) and choosing the web context, it’s not possible to get any text from labels such the h2 in the example or the text in the input.
I also checked in the Chrome dev tools that the text is there.
If I change to the Native context, most of the labels are easy to get. But I should not work with Native context because it’s a web Hybrid app and also the structure is different in the views/<div>
Capabilities in the Appium Driver:
caps.setCapability("platformName", "Android");
caps.setCapability("platformVersion", "11");
caps.setCapability("deviceName", "emulator-5554");
caps.setCapability("automationName", "UiAutomator2");
caps.setCapability("udid", "emulator-5554");
caps.setCapability("app",androidAppPath);
caps.setCapability("fullContextList", true);
driver = new AndroidDriver(appiumUrl, caps);
Environment
- Appium version: 1.22.0
- Desktop OS/version used to run Appium: macOS 10.15.7
- Node.js version: v14.17.5
- Npm or Yarn package manager: npm
- Mobile platform/version under test: Android 11
- Real device or emulator/simulator: Simulator
- Appium CLI or Appium.app|exe: Appium App
I also checked the version of ChromeDriver and the version of my Chrome are similar (except for the last three of numbers)
Chome version: 83.0.4103.XXX
Link to Appium logs
https://gist.github.com/CarlosNano/6bc077ce625e9c2af386c66185ebb9f2
Am I missing something here? Any help would be very appreciated. Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (1 by maintainers)
Top GitHub Comments
I think this is just how HTML works. Input elements don’t have a text property, they have a value attribute which corresponds to the text inside the box.
Closed as not an issue