When static methods should be used in Custom Keywords?

I noticed you have ever chatted with @Brandon_Hein about this at What exactly is "Default wait for element timeout (in seconds) " (in the Settings) and how exactly does it work?

I think that the Default Wait in KS does not apply to WebUI.setText().
I think that WebUI.setText(testObject) does not implicitly check and wait for the targeted HTML element <input type="text"> to be present and manipulatable. It immediately tries to manipulate it, and when the HTML element is not yet there, it fails.

In order to make your test robust, you should make explicit “wait” for the HTML node inputUserName which is subject to “WebUI.setText()”.


I think that KS should have internally applied the Default Wait to WebUI.setText() as well. There would be no harm in doing so. It would make easier for users to write stable tests — @gdearest07 you would have been helped. But KS is not designed as such. I regret that KS is not designed very consistent for “wait”. I think that newer testing framework Playwright is better in design for “wait”.

@ThanhTo

any comment?

1 Like