Does multithreading speed up the search of elemens?

Hi everyone,

Wil multithreading for finding elements speed up the execution of my script ?

I use Puthon 3.7.

My script need to find elements by string search. Because sometimes the button is in French, sometimes it is in English. There is no other ways than string search to get elements.

So my script is using several conditions IF:

If .....
     If .....
     Else...
Else...

I tested multithreading in order to seed up the execution.

Instead of event programming where lines of code need to wait previous lines, multithreading suppose to execute at same time my lines of code for finding the elements.

So I measure the duration, and the result is almost the same.

Is it normal?

I guess Appium server can’t make several requests to the smartphone at same time.

What do you think about?

Accessibility frameworks (both Android and iOS) don’t support concurrent access. This means that only one request could be made at a time. That is why Appium server puts all request, that are coming from a client, to a queue. So, it does not really matter if one sends them from a single or multiple threads - they are always executed in serial order.

Short answer to this question: no, this approach won’t make the tests faster. What could make - locators optimisation and disabling of animations in the app under test.

1 Like

But Appium Java client supports really complex seach simular to your example.

E.g. AndroidFindAll, AndroidFindBys and both together.