Search code examples
c#wpfui-automationwhite-framework

Write text to PasswordBox using Teststack.White


I'm trying to write password to PasswordBox in my WPF application using TestStack.White

I can find PasswordBox using

private TextBox Password => Window.Get<TextBox>(1);

But using Password.Text = "TestPassword" doesn't work

I also tried accessing keyboard with

Password.ClickAtCenter();
Thread.Sleep(1000);
keyboard.Enter(user.Password);

But without any luck.

How do I enter text into PasswordBox using White ?


Solution

  • Use the method Enter() of the teststack.white.textbox