Winium.Desktop icon indicating copy to clipboard operation
Winium.Desktop copied to clipboard

Winium is very slow

Open PradheepRaaj opened this issue 4 years ago • 4 comments

Winium is very slow while identifying elements

I am using Winium to automate legacy desktop application. But Winium is very slow while identifying elements in the application. Finding an element is taking almost 10 sec which eventually results slowness in execution

I am just using normal ways to point elements.(driver.findElement())

Is there any ways to overcome this?

PradheepRaaj avatar Jul 26 '19 13:07 PradheepRaaj

In Winium.Desktop driver represents the whole desktop, not only your app under a test.

The find method uses depth-first search, meaning that if there are a lot of windows open on the desktop and the element you are looking for turns out to be in the last window, the search will have to go through all of the elements in all previous windows.

To make your search faster, please limit the scope. First, find the application window and save the reference to a variable. Then, do any future searches from that element, not from the desktop.

Something like that:

aut=driver.find_element_by_xpath("/*[@AutomationId='MyApplication']")

# do all following search starting at aut element
aut.find_element_by_xpath("//*[@ClassName='TextBox']")
aut.find_element _by_ text("some text")
...

NickAb avatar Jul 28 '19 11:07 NickAb

Hi NickAb,

I have tried your suggested method. But still it is slow. Is there any other way like system configuration change which may boost the speed?

PradheepRaaj avatar Jul 29 '19 07:07 PradheepRaaj

@NickAb Can you suggest some other methods for this issue? Still experiencing same issue

PradheepRaaj avatar Aug 19 '19 04:08 PradheepRaaj

Hi NickAb,

I have tried your suggested method. But still it is slow. Is there any other way like system configuration change which may boost the speed?

While launching winium you would've used http://localhost:9999/

instead use http://127.0.0.1:9999/

@NickAb @PradheepRaaj

nananand7 avatar Jan 30 '20 09:01 nananand7