Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to find reported element when there is no accessibility Id in GTXiLib report? #15

Open
selin194 opened this issue Sep 15, 2019 · 7 comments

Comments

@selin194
Copy link

Hi all,
I have a question. I have successfully called GTXiLib on my UI tests and get a report of accessibility checks. However, I receive error report like:

Screen Shot 2019-09-15 at 12 52 24

I can not understand which UI buttons does this report try to point on. How can I learn which button is failing by reading this report? I mean should not this report include accessibility Id on the report to know the button that fails? Thank you @niksawtschuk @j-sid !

@aloksinha18
Copy link

@selin194 you have frame of element which might help you.

@selin194
Copy link
Author

I see, maybe I can use address information too. (By stopping my test at a specific point and see the address of the each element and check failure). Is there a way to add accessibility Id to the elements to the report? @sishuiOS , thank you.

@selin194 selin194 changed the title How to find reported element when there is no clue in GTXiLib report? How to find reported element when there is no accessibility Id in GTXiLib report? Sep 15, 2019
@niksawtschuk
Copy link
Contributor

I realize this isn't a perfect solution, but the failing element is set in the NSError's userInfo which is logged by the check:

kGTXErrorFailingElementKey: element,

If you put a breakpoint in this file, you can log whatever you'd like about the element in question.

I do agree that the element's description should include some additional info:

  • a11y identifier
  • text (if it's a UIButton?)
  • tag?
  • etc.

@j-sid I don't think it should be too difficult to add some extra logging to the element's description in NSError+GTXAdditions

@selin194
Copy link
Author

We can add additional key-value pairs to the userinfo, right?

@niksawtschuk
Copy link
Contributor

We can add additional key-value pairs to the userinfo, right?

@selin194 we certainly could, but the element's description is logged regardless, and since by default most UIView classes don't seem to add much useful information to their description, you don't get a good idea which element it's logging. I'm suggesting that we either add to that description, or add some category or extension which appends additional detail to description.

In the meantime, though, you could try adding a breakpoint to that file to do the check yourself.

@aloksinha18
Copy link

aloksinha18 commented Sep 17, 2019

@selin194 Hi ..I have integrated GtxiLib in UnitTests but I also need to integrate GtxiLib for my UITests as you have already integrated for UITests ..could you please explain how to use it for UITests target. Thanks.

@selin194
Copy link
Author

Hey @sishuiOS, for UITests we need to use EarlGrey library and create a new target by selecting IOS Unit Testing Bundle. After that we need to create a scheme whose target is newly created one. After that we can start to use GTXiLib features! Let me now if you have any question!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants