question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception on set text and button is not click

See original GitHub issue

Hello,

I’m can’t to use FlaUi, need help please.

First, I try set a text to a TextBox and showme a “System.InvalidOperationException”.

var pass = window.FindFirstDescendant(cf => cf.ByName("ds_pass"))?.AsTextBox();
pass.Text = "SUPER";

Second, I try click a button, but not happens:

window.FindFirstDescendant(cf => cf.ByName("OK"))?.AsButton().Click();

Thanks!!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Roemercommented, Oct 31, 2017

What kind of control is your textbox (WPF, WinForms, some library control)? As alternative, you could try using Enter instead of .Text.

0reactions
LevYascommented, Apr 7, 2022

This question is searchable by Google and I come across it while working on my problem, hope it helps others. I have WPF app, there’s a textbox and button bound to a command. When you enter something into textbox, the button become enable. But, I had a flaky test related to it. It worked fine on local machine, but on CI I got timeout error while waiting for the button to enable:

System.TimeoutException : Timeout occurred in retry Stack Trace: at FlaUI.Core.Tools.Retry.While[T](Func1 retryMethod, Func2 checkMethod, Nullable1 timeout, Nullable1 interval, Boolean throwOnTimeout, Boolean ignoreException, String timeoutMessage, Boolean lastValueOnTimeout, T defaultOnTimeout) at FlaUI.Core.Tools.Retry.WhileFalse(Func1 checkMethod, Nullable1 timeout, Nullable1 interval, Boolean throwOnTimeout, Boolean ignoreException, String timeoutMessage) at FlaUI.Core.AutomationElements.AutomationElementExtensions.WaitUntilEnabled[T](T self, Nullable1 timeout)

I used textBox.Text to set the value, and apparently it didn’t produce needed events. textBox.Enter() solved the problem, thank you Roemer!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception on set text and button is not click · Issue #116
First, I try set a text to a TextBox and showme a "System.InvalidOperationException". var pass = window.FindFirstDescendant(cf => cf.ByName(" ...
Read more >
Click all buttons and skip one when I get error exception ...
The problem is that not all buttons set are clicked since I get the exception. Basically if I set 20 clicks with limit,...
Read more >
Button | Android Developers
To specify an action when the button is pressed, set a click listener on the button ... Indicates that the content of a...
Read more >
The Shelly Cashman Series Microsoft Office 365 & Word 2021 ...
To set an exception to an AutoCorrect rule, click Options in Backstage view, ... type the exception entry in the text box, click...
Read more >
Microsoft Publisher 2019 Training Manual Classroom in a Book
Then, click “Find Next” to find the text you entered. You can then click the “Replace” button to replace the selected instance. Repeat...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found