question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webelements don't contain text properties when it's a Web Hybrid app with ionic

See original GitHub issue

We 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.

image image

I also checked in the Chrome dev tools that the text is there.

image

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:closed
  • Created 2 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jlippscommented, Feb 10, 2022

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.

0reactions
mykola-mokhnachcommented, Feb 13, 2022

Closed as not an issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

ion-text - Ionic Framework
ion -text is a simple app component that can be used to style the text color of any element. Learn how ion-text wraps...
Read more >
Test Automation Best Practices for Hybrid Apps - Apexon
Everything you need to know about app testing approaches, best practices to deal with hybrid mobile app in automation, designing testing approach for...
Read more >
Why I don't use web components - DEV Community 👩‍💻👨‍💻
There you show up a very simple case where whole component html representation could be rendered using just props (data-attributes). It's nice, ...
Read more >
All the Ways to Make a Web Component - Feb 2022 Update
Compare coding style, bundle size and performance of 61 different ways to make a Web Component.
Read more >
Properties - Stencil.js
Boolean Props. A property on a Stencil component that has a type of boolean may be declared as: import { ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found