Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How to Click on a link under a CTabFolder? (How to Click on a link under a TabFolder? or right click on the empty space or link to get context menu?)
How to Click on a link under a CTabFolder? [message #1430711] Wed, 24 September 2014 18:04 Go to next message
Minnie P is currently offline Minnie PFriend
Messages: 14
Registered: January 2013
Junior Member
I want to click on the link under a ctabfolder (that is what my spy view says). Then a new dialog window should be open.
OR
How do i right click on the empty space or link under the ctabfolder to get context menu?
I tried every possible way but i think the first issue is it doesn't even recognize the tabfolder.

index.php/fa/19251/0/

Here is my code:

tree = View.getTree("Servers");
link.click();

ERROR
-----------
org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 45000 ms.: The widget TreeItem with 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)

how exactly should I write this of kind code in SWTbot?
The online doc does not help me in anyway.
Any help would be appreciated.
Thanks.
  • Attachment: link.PNG
    (Size: 11.14KB, Downloaded 692 times)
Re: How to Click on a link under a CTabFolder? [message #1433720 is a reply to message #1430711] Mon, 29 September 2014 07:07 Go to previous messageGo to next message
Mickael Istria - away until August 14th is currently offline Mickael Istria - away until August 14thFriend
Messages: 833
Registered: July 2009
Location: Grenoble, France
Senior Member

I don't see a tree under this view...

I'd try
SWTBotView view = bot.viewByTitle("Servers");
view.show();
view.setFocus();
view.bot.link("No server [blah-blah]").click();

--
Mickael Istria
My job: http://www.jboss.org/tools
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Re: How to Click on a link under a CTabFolder? [message #1434238 is a reply to message #1433720] Mon, 29 September 2014 21:33 Go to previous messageGo to next message
Minnie P is currently offline Minnie PFriend
Messages: 14
Registered: January 2013
Junior Member
Thanks Mickael. The code worked till the focus is set on servers.But fails to click the link.It complains that the widget was not found.
Here is the code I have :

SWTBotView view = bot.viewByTitle("Servers");
view.show();
view.setFocus();
view.bot().link("No servers available.Define a new server from the new server wizard...").click();

org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find widget.
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:348)
at com.ibm.datatools.automation.swtbot.finders.Bot.waitUntilWidgetAppears(Bot.java:1)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.widget(SWTBotFactory.java:308)
at com.ibm.datatools.automation.swtbot.finders.Bot.widget(Bot.java:1)
at org.eclipse.swtbot.swt.finder.SWTBot.link(SWTBot.java:3664)
at com.ibm.datatools.automation.swtbot.finders.Bot.link(Bot.java:1012)
at org.eclipse.swtbot.swt.finder.SWTBot.link(SWTBot.java:3652)
at com.ibm.datatools.automation.swtbot.finders.Bot.link(Bot.java:1007)
at com.ibm.datatools.swtbot.tests.ims.transactionproject.TransactionTasks.createTransactionServer(TransactionTasks.java:330)
at com.ibm.datatools.swtbot.test.ims.common.testcases.TranProj.executeTest(TranProj.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:607)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
at java.lang.Thread.run(Thread.java:781)
Caused by: org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 45000 ms.: Could not find widget matching: (of type 'Link' and with mnemonic '<a>No servers available.Define a new server from the new server wizard...')
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:398)
at com.ibm.datatools.automation.swtbot.finders.Bot.waitUntil(Bot.java:1)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:372)
at com.ibm.datatools.automation.swtbot.finders.Bot.waitUntil(Bot.java:1)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(SWTBotFactory.java:360)
at com.ibm.datatools.automation.swtbot.finders.Bot.waitUntil(Bot.java:1)
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(SWTBotFactory.java:346)
... 36 more




Thanks,
Minnie
Re: How to Click on a link under a CTabFolder? [message #1434652 is a reply to message #1434238] Tue, 30 September 2014 11:59 Go to previous messageGo to next message
Mickael Istria - away until August 14th is currently offline Mickael Istria - away until August 14thFriend
Messages: 833
Registered: July 2009
Location: Grenoble, France
Senior Member

On 09/29/2014 11:33 PM, Minnie P wrote:
> view.bot().link("No servers available.Define a new server from the new
> server wizard...").click();

Aren't you missing a space between the first dot and "Define" ?
--
Mickael Istria
My job: http://www.jboss.org/tools
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Re: How to Click on a link under a CTabFolder? [message #1434962 is a reply to message #1434652] Tue, 30 September 2014 21:39 Go to previous message
Minnie P is currently offline Minnie PFriend
Messages: 14
Registered: January 2013
Junior Member
Just the space didnt work but apparently it had some hidden characters which i could see only from a spy view.
This worked.
view.bot().link("<a>No servers available. Define a new server from the new server wizard...</a>").click();

Thanks Mickael again for the help.


Thanks,
Minnie

[Updated on: Tue, 30 September 2014 22:18]

Report message to a moderator

Previous Topic:"WorkbenchTestable - No Classloader found for plug-in
Next Topic:How to test RCP application with login screen?
Goto Forum:
  


Current Time: Mon Nov 19 00:42:05 GMT 2018

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

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

Back to the top