Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How to Set or type text in TextField of Table..?(I have Tree which is Table/Cell Format. After clicking a particular Cell aTextField appears. I want to Type or Set Text in that table cell.)
How to Set or type text in TextField of Table..? [message #1728690] Wed, 06 April 2016 13:09 Go to next message
Sumit Ganjale is currently offline Sumit GanjaleFriend
Messages: 7
Registered: April 2016
Junior Member
Hi All,
I have Tree which is Table/Cell Format.
After clicking a particular Cell aTextField appears.
I want to Type or Set Text in that table cell.

Please see the attachment.
Please help its kind of Important.

Thanks.
Sumit
  • Attachment: BOT.png
    (Size: 16.89KB, Downloaded 311 times)

[Updated on: Thu, 07 April 2016 04:50]

Report message to a moderator

Re: How to Set or type text in TextField of Table..? [message #1728752 is a reply to message #1728690] Thu, 07 April 2016 05:57 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1751
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 06/04/2016 15:09, Sumit Ganjale wrote:
> Hi All,
> I have Tree which is Table/Cell Format.
> After clicking a particular Cell aTextField appears.
> I want to Type or Set Text in that table cell.
>
> Please see the attachment.
> Please help its kind of Important.
>
> Thanks.
> Sumit
>

Hi

something like this should work:

table.click(ROW, column);
bot.text(originalValue).setText(newValue);

This is taken from here:
http://git.eclipse.org/c/emf-parsley/org.eclipse.emf-parsley.git/tree/tests/org.eclipse.emf.parsley.tests.swtbot/src/org/eclipse/emf/parsley/tests/EmfParsleyEditableTableTests.java

--
Prof. Lorenzo Bettini, Computer Science, DISIA, Univ. Firenze
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: How to Set or type text in TextField of Table..? [message #1728799 is a reply to message #1728752] Thu, 07 April 2016 12:58 Go to previous messageGo to next message
Sumit Ganjale is currently offline Sumit GanjaleFriend
Messages: 7
Registered: April 2016
Junior Member
Hi,

Thanks for reply but its not working in my case its giving exception as


"Caused by: org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 5000 ms.: The widget (of type 'Text') was not enabled.
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:398)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:372)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:360)
at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.waitForEnabled(AbstractSWTBot.java:635)
at org.eclipse.swtbot.swt.finder.widgets.SWTBotText.setText(SWTBotText.java:61)
at com.majescomastek.stgicd.tests.jobs.AcceptDomainDataModelTestJob$1.run(AcceptDomainDataModelTestJob.java:149)
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:155)
at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
...
Re: How to Set or type text in TextField of Table..? [message #1728801 is a reply to message #1728799] Thu, 07 April 2016 13:29 Go to previous message
Sumit Ganjale is currently offline Sumit GanjaleFriend
Messages: 7
Registered: April 2016
Junior Member
Hi Lorenzo Bettini,
Thanks for the help. Really appreciate it. Actually I got frustrated with this issue. Finally got it working. Here's what I did.


  • click on the table cell table.click(row, column);
  • count the index of the text on current editor screen prior to my cell editor say x
  • bot.text(x+1).setText("MyDesiredText");;
  • Repeated the same for other text cell editors in the table. Note that I used the same number i.e. x+1 to find all further text cell editors


Thanks once again!
Previous Topic:How to select an Item in ComboBox of a Tree..
Next Topic:using @Category annotation with SWTBot
Goto Forum:
  


Current Time: Tue Sep 25 18:51:48 GMT 2018

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

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

Back to the top