Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTBot with dialog
SWTBot with dialog [message #692876] Tue, 05 July 2011 11:48 Go to next message
dengtao  is currently offline dengtao Friend
Messages: 2
Registered: July 2011
Junior Member
Hi All:
I use SWTBot to test our product.And All My Test works fine on my machine!
Now I move the build to Hudson(use another machine),All my Test goes fine except one.
The failed TestCase need to open a dialog,code:

bot = new SWTWorkbenchBot();
//find view
SWTBot viewbot = bot.viewById(DrugUsedbfxView.ID).bot();
//find text and trigger "enter" will show the dialog
viewbot.textWithId("txtYpbh").pressShortcut(SWT.CR, SWT.LF);

SWTBotShell shellbot ="shell name");

When I open the RDP,the case can pass,I close the RDP or minimum the RDP,the case goes wrong.

Re: SWTBot with dialog [message #692877 is a reply to message #692876] Tue, 05 July 2011 11:51 Go to previous messageGo to next message
dengtao  is currently offline dengtao Friend
Messages: 2
Registered: July 2011
Junior Member

Running com.ztkj.his.zhcx.test.ZhcxMzTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.062 sec
Running com.ztkj.his.zhcx.test.ZhcxZyTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Running com.ztkj.his.zhcx.test.ZhcxWzTest
log4j:WARN No appenders could be found for logger (org.eclipse.swtbot.swt.finder.matchers.AbstractMatcher).
log4j:WARN Please initialize the log4j system properly.
Tests run: 17, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 16.593 sec <<< FAILURE!
testDbfx(com.ztkj.his.zhcx.test.ZhcxWzTest) Time elapsed: 5.734 sec <<< ERROR!
org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find widget.
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(
at org.eclipse.swtbot.swt.finder.SWTBotFactory.shells(
at com.ztkj.his.zhcx.test.ZhcxWzTest.testDbfx(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
at org.junit.internal.runners.statements.RunBefores.evaluate(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.ParentRunner$
at org.junit.runners.ParentRunner$1.schedule(
at org.junit.runners.ParentRunner.runChildren(
at org.junit.runners.ParentRunner.access$000(
at org.junit.runners.ParentRunner$2.evaluate(
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(
at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.runTests(
at org.eclipse.ui.internal.testing.WorkbenchTestable$
Caused by: org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 5000 ms.: Could not find shell matching: with text '药品资料'
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntil(
at org.eclipse.swtbot.swt.finder.SWTBotFactory.waitUntilWidgetAppears(
... 29 more
Re: SWTBot with dialog [message #694265 is a reply to message #692876] Fri, 08 July 2011 08:27 Go to previous message
Benjamin Ratiarisolo is currently offline Benjamin RatiarisoloFriend
Messages: 16
Registered: January 2010
Location: Paris, France
Junior Member
This reminds me of a similar issue I had when deploying our SWTBot test suites to our continuous integration framework (I am using windows as OS on my development platform while the continuous integration servers usually run on Linux).

I had to specifically set the SWTBot keyboard layouts property for keyboard-shortcut based tests to successfully run in the continuous integration environment: I added '-Dorg.eclipse.swtbot.keyboard.layout=EN_US' in the vmargs property of the swtbot-test ANT task. It seemed to work fine for me then.

You can give it a try.

Benjamin Ratiarisolo
IBM ODM Decision Server Rules - Software Developer
IBM Software - France Lab
Previous Topic:"Confirm Disable Builder" Dialog -how to access?
Next Topic:How can I properly select a radio button using SWTBot?
Goto Forum:

Current Time: Wed May 23 15:19:37 GMT 2018

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

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

Back to the top