Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How can I get a TableItem's text?(I get an invalid thread access message)
How can I get a TableItem's text? [message #549932] Wed, 28 July 2010 13:48 Go to next message
John Ormerod is currently offline John OrmerodFriend
Messages: 39
Registered: January 2010
Member
In my SWTBot 'script' I have selected a TableItem. In the debugger, I can see that the SWTBotTableItem has a widget that is the underlying TableItem. However, if I add some code to cast the widget and invoke the getText() method, I get an exception for an invalid thread access (this is also what the debugger shows, when the widget is selected).

I tried using a Display.getCurrent().syncExec() to run this code, but it never got invoked.

Is what I am trying to do possible?

Regards, John
Re: How can I get a TableItem's text? [message #549999 is a reply to message #549932] Wed, 28 July 2010 17:17 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
An SWTBotTableItem is a wrapper for TableItem that represents a row.

To get text in a particular you can use either:

table.cell(row, columIndex_or_header_string)

OR

tableItem.getText(columnIndex)

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot

On 7/28/10 6:48 AM, John Ormerod wrote:
> In my SWTBot 'script' I have selected a TableItem. In the debugger, I
> can see that the SWTBotTableItem has a widget that is the underlying
> TableItem. However, if I add some code to cast the widget and invoke the
> getText() method, I get an exception for an invalid thread access (this
> is also what the debugger shows, when the widget is selected).
>
> I tried using a Display.getCurrent().syncExec() to run this code, but it
> never got invoked.
>
> Is what I am trying to do possible?
>
> Regards, John
Previous Topic:How do I define a multiple selection?
Next Topic:CheckboxTableViewer problem
Goto Forum:
  


Current Time: Tue Apr 23 06:42:03 GMT 2024

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

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

Back to the top