Skip to content
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

How to find Edit Control ? #78

Open
neilyoung2008 opened this issue Apr 8, 2019 · 6 comments
Open

How to find Edit Control ? #78

neilyoung2008 opened this issue Apr 8, 2019 · 6 comments

Comments

@neilyoung2008
Copy link

FindChildAt(Index)is work,but SOMETIMES the index is not const in different app version, why not add the interface named FindEdit like “FindTextBox" ?

@JohanLarsson
Copy link
Member

What is an edit control?

@neilyoung2008
Copy link
Author


flaUInspect

@neilyoung2008
Copy link
Author

class name is Edit , control type is Edit , as above .

@neilyoung2008
Copy link
Author

flaUInspect

@JohanLarsson
Copy link
Member

What does the xaml for the control look like?

There is API for finding custom controls but it is not pretty. Something like below should work:

var edit = window.FindFirst(
    TreeScope.Descendants,
    new AndCondition(Conditions.ByClassName("Edit"), Conditions.ByControlType(ControlType.Edit)),
    x => new EditControl(x),
    Retry.Time);

Where EditControl is your custom wrapper.

If this is a WPF control we should definitely support it in a better way.

@JohanLarsson
Copy link
Member

Can you make a pull request with a window containing the control? Placing it in this folder would be perfect: https://github.com/GuOrg/Gu.Wpf.UiAutomation/tree/master/TestApplications/WpfApplication/Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants