-
Notifications
You must be signed in to change notification settings - Fork 12
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
Very slow object recognition when using longer or gapped XPaths #180
Comments
Currently roboframework-flaui use always from desktop find first by xpath usage Flaui supports additonal search patterns which could be potential an improvement for a better xpath element search The possibility to use them should be implemented in future scope. Asweel flaui supports caching from elements https://github.com/FlaUI/FlaUI/wiki/Caching This can be used to store all found elements from cache. So only first search would be take a long time afterwards all keywords should be improved. So this automatic caching feature must be implemented into robotframework-flaui.
I think caching has to be designed as keyword as main element which will be used afterwards to the search pattern. |
Such manual caching for every xpath individualy is very time consuming to write the test cases. Even this suggestion will not solve the performance issue @JonasBeiTXS is facing. Because his highest reliable window is not the main window of an one app existing in the ui tree. This means to find the corresponding reliable element will take time for caching too. Because it will go deep in every app found in the ui tree. Maybe caching helps for several clicks but after some update it is needed to recache otherwise will crash it will retake a long time again. The only reason it is taking more than 30 second is that you have relatively crowded ui tree. Try to minimize windows number while you are testing. Look into this conversation #82 to see some wildcards available like contains or starts-with. To limit the xpath as much as possible. Best possible xpath would be using /Mainwindow[Someconstraint]//Pane[@AutomationId="leftPane"]/Pane/Pane/ToolBar/Button[@name="loadingButton"] rather than //Pane[@AutomationId="leftPane"]/Pane/Pane/ToolBar/Button[@name="loadingButton"] |
Thanks for the quick responses. @noubar's suggestion greatly improved our execution time. Adding |
We are experiencing very long object recognition times when using XPaths that contain "gaps".
Previously we used something like this:
Object recognition was pretty much instant.
But now we sometimes have the same loading button on screen multiple times. Therefore we need to differentiate and reference a unique parent container. This is our current solution:
In this case
leftPane
is the closest reliably identifiable parent element. The object tree would look something like this:When using these longer XPaths, load times are about 30s per button, which seems excessive.
This is just one example. We have many other cases, where using the end of an XPath is very fast, but incorporating parent elements slows down object recognition considerably.
Is this known behavior? Can we do anything to speed up object recognition (on the automation side of things)?
Filling the "gap" like this did not yield any noticable improvements:
The text was updated successfully, but these errors were encountered: