Question

I follow a book called Eclipse Plugin Development by Example: Beginner's Guide and all examples are hosted at github. However, I can't successfully run SWTBot example.

The first time it takes a very long time to run, but in the end it would pass all test cases. However when I try to run the same code second time, it only testUI() will pass, the other three will have org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: The widget was null.

Somewhere in the book is said

If one (shell) is not currently visible, it polls (every 500 milliseconds by default) until one is found or the default timeout period (5 seconds) ends when a WidgetNotFoundException is thrown But I don't see why the first time all test cases will pass but not the second time.

but I have not idea why the first time will work but second time won't.

I also report this at github issue but so far no one response.

Was it helpful?

Solution

did you interfere with your desktop while the test was running? I found this can (!) cause problems with SWTBot. Also, WidgetNotFound is an exception you'll be seeing a lot when using this framework. Sometimes it might be due to bugs, sometimes to unusual underlying UI code. It should be reproducible in those cases, though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top