FlaUI / FlaUI

UI automation library for .Net
MIT License
2.21k stars 363 forks source link

Empty RichTextBox control returns a CR (0x13) #104

Open danhi opened 6 years ago

danhi commented 6 years ago

When getting the value from a RichTextBox control that is empty, it returns a single CR. I get the element using AsTextBox, and then use the .text subitem. Maybe I should be using something else?

Roemer commented 6 years ago

Can you provide a simple demo application? Also you could try the "Text" pattern and see if that helps (haven't used that pattern yet but I implemented it).

danhi commented 6 years ago

I was using the Text pattern.

You can download http://www.danhinsley.com/downloads/Testharness.zip. It’s a very simple VB app that launches itself when you click on the button. You can then see that you get for the text pattern (as well as other things like name).

Roemer commented 6 years ago

That seems to be a bug in the WinForms control which does not happen in the WPF control. It would probably make sense to add a RichTextBox control to FlaUI which takes care of this.

danhi commented 6 years ago

Well, let me know when you have something you want me to test. It's easy to work around, since I just add .trim to where I retrieve it.