Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot() - Could not find a display - Eclipse 2020
SWTBot() - Could not find a display - Eclipse 2020 [message #1834099] Mon, 02 November 2020 16:10 Go to next message
Cédric Parpet is currently offline Cédric ParpetFriend
Messages: 2
Registered: November 2020
Junior Member
Hi,
I'm trying to use SWTBot on Eclipse and run into some trouble when following some tutorials and exemple.
On eclipse 2020-09 whenever I try to run a code I get an error due to the method SWTBot() to initialize the bot.
index.php/fa/39183/0/
index.php/fa/39184/0/

It happened with several tutorials or exemple I followed, like these ones (can't give the url as i'm new):
SWTBot for testing Eclipse Applications - Tutorial - on vogella website
https://wiki.eclipse.org/SWTBot/UsersGuide
Testing SWT GUI with SWTBot - on StackOverflow


When trying these on a previous version of eclipse 2019-06 it works (or in vogella's exemple, the error are no longer due to the initialization of the bot but to missing elements in UI).
index.php/fa/39186/0/
index.php/fa/39185/0/

About the code I'm testing:
For vogella it's the one in the section 4.3 Create Test
In the userGuide it's the one in section "Getting started with SWTBot for Eclipse Plugins"

About my run Configurations:
On the 2020 I tried with both JUnit plugin test and SWTBot Test. I was careful to not run the test in UI thread as said in documentation. I run the tests with java 1.8 and java 14.
On the 2019 version I tried only with the JUnit Plugin test and without thread UI, I run the tests with java 1.8.

So what I'm looking for is a way to run my tests with SWTBot on the 2020 version. I couldn't find any information about such error.
I will gladly provide more informations if you need.
Re: SWTBot() - Could not find a display - Eclipse 2020 [message #1834370 is a reply to message #1834099] Mon, 09 November 2020 08:37 Go to previous messageGo to next message
Cédric Parpet is currently offline Cédric ParpetFriend
Messages: 2
Registered: November 2020
Junior Member
Turns out the problem was not due to a different version of eclipse but to a specific module in another project in my workspace. I remove it and now it's ok.
Re: SWTBot() - Could not find a display - Eclipse 2020 [message #1834466 is a reply to message #1834370] Tue, 10 November 2020 19:26 Go to previous message
Patrick Tasse is currently offline Patrick TasseFriend
Messages: 84
Registered: July 2009
Member
Hi Cedric,

Sorry for the late reply. I'm glad you resolved your problem and it's nice that you follow-up with the explanation of your issue.

Before I saw your response I was going to suggest to verify how your Run/Debug Configuration was setup, in Main > Program to Run.

We usually put Run a product: org.eclipse.platform.ide. It's the application that creates the display so if it was set to Run an application: Headless Mode then there is no display and we get the same error you reported.

Patrick
Previous Topic:SWTBot _Tycho
Next Topic:How to open a menu?
Goto Forum:
  


Current Time: Tue Apr 23 13:01:04 GMT 2024

Powered by FUDForum. Page generated in 0.03755 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top