-
Notifications
You must be signed in to change notification settings - Fork 20
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
CPU usage when use find the element #29
Comments
Looks like it happens only when I am looking for an element that is not found. I am not getting jabexception as I am using find_element_by_xpath in a try ...except block. It seems that find_element_by_xpath is looking for my element in all nodes, which is expected. |
Hi @szczepanR,
So, the logic is pretty simple here:
The key point in here, the logic for find element will not loop all children, if find your specific jabelemnt, pyjab will stop iteration and return the jabelement which is found by pyjab.
Back to your question, pyjab does not known the jabelement you have specific in which level of node tree. |
upload cprofile results for reference
|
Thanks (again :)) for your answer. Of course, I will try to find the solution, but my experience in python is very small (as you probably noticed :)). |
I played with the function
It seems that break after the specific value of Can you check whether it might be the correct solution? |
Hi @szczepanR
|
From "Access bridge explorer", "index in parent" is unique for every child. So it does not describe level of children, |
That's why suggest you have to find "parent" jabelement first, then find your specific child jabelement by index_in_parent. Also, you can combine you locator such as "@ObjectDepth=2 and @indexinparent=3" with xpath. |
I don't know "index_in parent" as this child element can appear in a specific situation. I know only the parent of this element. That is why I need to "scan" first-level children just to get info that this element appears. All built-in functions don't allow to "scan" specific level of children. They go to grandchildren and that is why CPU consumption is high. |
I think the issue is also visible in NVDA, I installed it and tried to detect some elements. CPU usage is also high :( |
Hi @szczepanR, Thanks for your investigation. Is that possible the JAB API makes high CPU consumption. |
Possible, but I don't see high CPU usage in access bridge explorer
|
Hi,
can you check what is the CPU consumption for the java application under test during execution i.e. find_element_by_name or find_element_by_xpath?
Task Manager on my VM (hyper-v ws2019) shows about 24%, a pretty high, isn't it?
thanks in advance
The text was updated successfully, but these errors were encountered: