Skip to content

Is it possible that MobileElement/AndroidElement/IOSElement support element description? #478

Description

@ansonliao

Description

Hi,
For more details to track the test operation/flow in test report (for example, ReportNG, ExtentsReport), is it possible that add a public String field to MobileElement/AndroidElement/IOSElement for storing the element's description?

for example:

publicclassHomePageObjects {
@iOSFindBy(id = "submit", description = "Home page - [Submit] button")
publicIOSElementsubmitButton;
...
}
publicclassProfilePageObjects {
@iOSFindBy(id = "submit", description = "Profile page - [Submit] button")
publicMobileElementsubmitButton;
}

so that in calling reporter's log method in personal Appium test project:

publicvoidclick(MobileElemente) {
e.click();
// reportNGreporter.log("Click: " + e.getDescription());
}
publicvoidclearText(MobileElemente) {
e.clear();
//reportNGreporter.log("Clear Text: " + e.getDescription());
}
publicvoidenterText(MobileElemente, Strings) {
e.sendKeys(s);
//reportNGreporter.log("Type Text: " + e.getDescription());
}
publicvoidswipDown(MobileElemente) {
//add code here
}

so that the test report will be more detail as mobile description supported:

Snipshot of ReportNG:

Type: ......
Swipe Down: ....
Clear Text: ...
...
Click: Home page - [Submit] button
...
Click: Profile page - [Submit] button
Test fail
Error: MobileElemet: by.id = "submit" still displayed.

tracking test report test operation flow, it is more easier to locate the it was fail after click profile page submit button, not home page submit button.

please advise.

Please describe the issue. It may be a bug description. So then please briefly descride steps which you were trying to perform and what happened instead.
If there is the feature you want to see added to Appium Java client so please describe necessity of this feature and the way that it should work.

Environment

  • java client build version or git revision if you use some shapshot:
  • Appium server version or git revision if you use some shapshot:
  • Desktop OS/version used to run Appium if necessary:
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:
  • Mobile platform/version under test:
  • Real device or emulator/simulator:

Details

Please provide more details, if necessary.

Code To Reproduce Issue [ Good To Have ]

Please remember that, with sample code; it's easier to reproduce bug and much faster to fix it.
You can git clone https://github.com/appium/sample-code or https://github.com/appium/sample-code/tree/master/sample-code/apps and reproduce an issue using Java and sample apps.
Also you can create a gist with pasted java code sample or put it here using markdown. About markdown please read Mastering markdown and
Writing on GitHub

Ecxeption stacktraces

Please create a gist with pasted stacktrace of exception thrown by java.

Link to Appium logs

Please create a gist which is a paste of your full Appium logs, and link them here. Do not paste your full Appium logs here, as it will make this issue very long and hard to read!
If you are reporting a bug, always include Appium logs as linked gists! It helps to define the problem correctly and clearly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions