I
I
Ivan Gaidamakin2016-04-22 10:01:19
iOS
Ivan Gaidamakin, 2016-04-22 10:01:19

What is the difference between isHittable and exists?

Good afternoon!
I am writing UI tests for iOS and then I ran into a question, what is the difference between exists and isHittable?
I read the following inscription on isHittable: Whether or not a hit point can be computed for the element for the purpose of synthesizing events.
But still didn't understand what it meant.
Thank you in advance!
Regards, Ivan.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2016-04-22
@MeGaPk

everything is clear from the names themselves:
exists - whether the element exists.
isHittable - whether it is possible to interact with the element (respond to click/touch/gesture).
for example, we display a table of 50 rows. those cells that are visible on the screen are both exists and hittable . a those that don't fit on the screen have exists , but not hittable .
I think it will be clear:

if (dateTextField.exists) {
    NSLog(@"date field exists");
}
if (dateTextField.hittable) {
    NSLog(@"date field action is possible");
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question