Forum Discussion

artur_biesiadow's avatar
artur_biesiadow
New Contributor
12 years ago

java/SWT Display.syncExec

I'm trying to control internals of RCP application from TestComplete. For read access, it works quite well, but when I try to open a new view using code (activePage.showView(id)) it complains about illegal thread access.



I would need to call Display.syncExec(Runnable) with some code inside runnable. Is there any way to achieve it from inside TestComplete script?

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Artur,


     


    I consulted with our R&D team and they've provided me with the following information: TestComplete will correctly work with the right thread only if you call a property/method of the SWT widget that will be inherited from org.eclipse.swt.widgets.Widget.


    In the target thread, you will need to execute the following code:


    Widget.getDisplay().asyncExec


     


    So, if a special method is created for a visible widget in your app - you need to call it from TestComplete. Thus, you should avoid this error.