Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How to insert text into Editor (Table) ?(Like a Table of Microsoft Excel.)
How to insert text into Editor (Table) ? [message #544454] Fri, 02 July 2010 17:45 Go to next message
Caio Bulgarelli is currently offline Caio Bulgarelli
Messages: 16
Registered: February 2010
Junior Member
I would like to know How can I insert a text inside a cell in Editor View?

Example:

First
http://i752.photobucket.com/albums/xx163/caiob3/001_Editor_CONTACTS.jpg

After
http://i752.photobucket.com/albums/xx163/caiob3/002_Editor_CONTACTS.jpg


I tried to do this, and it works:

//Editor
bot.editorByTitle("CONTACTS").setFocus();
bot.editorByTitle("CONTACTS").bot().table().click(0, 1);

But, I just clicked ...
Now... I need to set a text, so...
HOW CAN I SET A TEXT ?
Re: How to insert text into Editor (Table) ? [message #544518 is a reply to message #544454] Sat, 03 July 2010 07:36 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
On 7/2/10 10:45 AM, Caio Bulgarelli wrote:
> I would like to know How can I insert a text inside a cell in Editor View?
>
> Example:
>
> First
>
>
> After
>
>
>
> I tried to do this, and it works:
>
> //Editor
> bot.editorByTitle("CONTACTS").setFocus();
> bot.editorByTitle("CONTACTS").bot().table().click(0, 1);
>
> But, I just clicked ...
> Now... I need to set a text, so...
> HOW CAN I SET A TEXT ?
>

Here's an example. It clicks on a cell and sets text into it.

http://github.com/ketan/swtbot/blob/master/org.eclipse.swtbo t.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/ SWTBotTableClickTest.java

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot
Re: How to insert text into Editor (Table) ? [message #544851 is a reply to message #544518] Mon, 05 July 2010 17:31 Go to previous messageGo to next message
Caio Bulgarelli is currently offline Caio Bulgarelli
Messages: 16
Registered: February 2010
Junior Member
Hi Ketan!

First of all, thanks for you reply.

But... This example didn't work for me.
I'm trying to set a text (to put) inside cell a lot of differents ways, but I'm not having sucess.

LIKE THIS:

private static SWTWorkbenchBot bot;
private static SWTBotTable table;

//Editor
bot.editorByTitle("CONTACTS").setFocus();
table = bot.editorByTitle("CONTACTS").bot().table();

table.click(0, 1);
bot.text().setText("My Test here!!!!!");



However, this last line causes an Excepiton (WidgetNotFound)

So... Do you know why?
Any idea?
Re: How to insert text into Editor (Table) ? [message #547179 is a reply to message #544851] Thu, 15 July 2010 20:06 Go to previous message
Brian Yu is currently offline Brian Yu
Messages: 10
Registered: July 2009
Junior Member
Thanks, the example worked in my case where the table is located in a custom dialog.
Sorry, not sure why it is not working for the table in your editor.


SWTBotTable table = bot.table();

// Activate a particular table cell.
table.click(0, 2);
bot.text().setText("New Value");
table.click(0, 1); // Clicks elsewhere, to lock in the new value.



[Updated on: Thu, 15 July 2010 20:07]

Report message to a moderator

Previous Topic:JRuby Support (strikes back)
Next Topic:Running SWTBot headless
Goto Forum:
  


Current Time: Wed Oct 01 08:25:54 GMT 2014

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

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