Comments (9)
Could you provide some code with what you've done? Would be easier to get a better idea about what you're trying to do
from flaui.
var app = FlaUI.Core.Application.Attach("xxx.exe");
using (var automation = new UIA3Automation())
{
var window = app.GetAllTopLevelWindows(automation).FirstOrDefault(t => t.Name == "Client.Main.Views.AppendViewModel");
window.FindFirstDescendant(t => t.ByName("Accept")).AsButton()?.Invoke();
}
from flaui.
Can you please measure each call individually (app.GetAllTopLevelWindows
, window.FindFirstDescendant
) to see which of those 2 is the slower one?
If it indeed is the first one, you can always directly search the window directly:
var window = automation.GetDesktop().FindFirstChild(cf =>
cf.ByControlType(ControlType.Window)
.And(cf.ByProcessId(app.ProcessId))
.And(cf.ByName("Client.Main.Views.AppendViewModel"))
);
from flaui.
GetAllTopLevelWindows is slower, taking 3 seconds, but the new method you provided is effective, reducing the time to 0.2 seconds. Additionally, GetAllTopLevelWindows is not as slow as before, perhaps because my system has been restarted.
from flaui.
When it gets all windows from the top level (desktop), UIA queries the Windows-Objects underneath and it might encounter a window (application) that is hanging for some time until it responds, making the whole request slow. If you want, you could try to get each window from the GetDesktop
individually and see, if there is one or a few that takes longer to get a response.
from flaui.
How do I enumerate it? The code in the loop passes quickly, and the time is concentrated on FindAllChildren.
foreach (var element in automation.GetDesktop().FindAllChildren(a => a.ByControlType(FlaUI.Core.Definitions.ControlType.Window)))
{
element.Name.Dump();
element.FindAllChildren();
}
from flaui.
Related Issues (20)
- Vulnerable dependency System.Drawing.Common
- Can I hide an element ? HOT 1
- GetAllTopLevelWindows takes forever HOT 3
- `Keyboard.Press` only supports `VirtualKeyShort`, not `char` like `Keyboard.Type`
- Menu item can only be found after getting `GetMainWindow` again HOT 2
- Cannot find some existing elements by FindAllDescendants() HOT 3
- Create a new AutomationElement based on UserControl HOT 1
- Unable to get the text for ComboBoxItem HOT 2
- Could not find process with id HOT 4
- I cannot get the combo box list. HOT 2
- Process ID returned by FlaUI.Core.Application is different from windows process ID HOT 2
- When Flaui will support .net core 8.0 HOT 2
- Instance of an object from System.Windows.Input halves the point passed to Mouse.Click HOT 1
- How to find and write this textbox
- FindAllDescendants does not return all descendants HOT 8
- how to load a windows store app photo app
- Jenkins machines cannot capture elements with ControlType: UIA_WindowControlTypeId (0xC370) and LocalizedControlType: "dialog" HOT 1
- Taking text pattern information from grid header and cells
- The latest release (4.0.0) depends on deprecated (and vulnerable) libraries
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flaui.