From: Niels S. <ja...@pp...> - 2004-10-27 14:46:15
|
Hi, I couldn't figured out how to get a reference to the script from StepRunner, so I had to focused on the ComponentReference. I'm glad to say that I could reduce the number of scripts which fails down to 4 or 5 (unfortunately it's still not deterministic). What have I done: 1. If I had a changed the StepRunner.runStep method. In the default case of the if/Ifelse-block I call patientRunStep(step) instead of step.run(). 2. I wrote the folling patientRunStep method. The method makes a second try or a lot of further tries. On a second try the Cache is disabled. private void patientRunStep(final Step step) throws Throwable { final long polling =3D 100; final long timeout =3D 10000; final int minimumNrOfAttempts =3D 2; Throwable anError =3D null; long stopTime =3D System.currentTimeMillis() + timeout + 1; int nrOfAttempts =3D 0; while (nrOfAttempts < minimumNrOfAttempts || stopTime >=3D System.currentTimeMillis()) { nrOfAttempts++; try { try { step.run(); if (anError !=3D null) { System.err.println("Fixed Ignored Error"); Log.debug("Fixed " + anError.getMessage()); } ComponentReference.setCachedLookupAllowed(true); return; } catch(Throwable th) { // keep waiting System.err.println("Ignore Error: " + th.getMessage()); Log.debug(th); anError =3D th; ComponentReference.setCachedLookupAllowed(false); } Thread.sleep(polling); } catch(InterruptedException ie) { } } throw anError; } 3. I changed ComponentReference by inserting static member static boolean cachedLookupAllowed =3D true; with an setter. and changed the method getCachedLookup if (cachedLookup !=3D null && cachedLookupAllowed) { So now it runs fine with 12.4. I will test this approach with 13.0. It wou= ld be nice if you give me some feedbacks to the changes, I will send than a patch to abbot (of course making constants in patientRunStep variable over System.properties). Now lets have a look to the last 3 failures: One of them is a littlebit strange, abbot couldn't find the popup for the combobox. Thats sound for me that there is a component reference wrong. Any ideas? =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D Kann kein Popup f=FCr die JComboBox finden abbot.tester.ActionFailedException: Kann kein Popup f=FCr die JComboBox finden at abbot.tester.JComboBoxTester.findComboList(JComboBoxTester.java: 67) at abbot.tester.JComboBoxTester.actionSelectIndex(JComboBoxTester.j ava:56) at abbot.tester.JComboBoxTester.actionSelectItem(JComboBoxTester.ja va:115) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI mpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA ccessorImpl.java:25) at abbot.script.Call.invoke(Call.java:187) at abbot.script.Call.runStep(Call.java:129) at abbot.script.Step.run(Step.java:75) at abbot.script.StepRunner.patientRunStep(StepRunner.java:345) at abbot.script.StepRunner.runStep(StepRunner.java:236) at abbot.script.Sequence.runStep(Sequence.java:109) at abbot.script.StepRunner.runStep(StepRunner.java:225) at abbot.script.Sequence.runStep(Sequence.java:109) at abbot.script.Script.runStep(Script.java:511) at abbot.script.StepRunner.runStep(StepRunner.java:225) at abbot.script.StepRunner.run(StepRunner.java:172) at junit.extensions.abbot.ScriptFixture.runTest(ScriptFixture.java:28) at junit.extensions.abbot.ResolverFixture.runBare(ResolverFixture.java:86 ) at junit.extensions.abbot.ComponentTestFixture.runBare(ComponentTest Fixture.java:298) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D Here is another typical error: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D Testcase: scripts\abbot\generated\dsgv\Test_DSGV_234_779_8030401.xml took 305,689 sec Caused an ERROR Can't obtain position of component '890173:890173' (JTabbedPane) abbot.tester.ComponentNotShowingException: Can't obtain position of component '890173:890173' (JTabbedPane) at abbot.tester.Robot.mouseMove(Robot.java:679) at abbot.tester.Robot.mousePress(Robot.java:942) at abbot.tester.JComponentTester.mousePress(JComponentTester.java: 96) at abbot.tester.Robot.click(Robot.java:1027) at abbot.tester.Robot.click(Robot.java:1006) at abbot.tester.Robot.click(Robot.java:1001) at abbot.tester.JTabbedPaneTester.actionSelectTab(JTabbedPaneTester .java:27) at abbot.tester.JTabbedPaneTester.actionSelectTab(JTabbedPaneTester .java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI mpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA ccessorImpl.java:25) at abbot.script.Call.invoke(Call.java:187) at abbot.script.Call.runStep(Call.java:129) at abbot.script.Step.run(Step.java:75) at abbot.script.StepRunner.patientRunStep(StepRunner.java:346) at abbot.script.StepRunner.runStep(StepRunner.java:236) at abbot.script.Sequence.runStep(Sequence.java:109) at abbot.script.StepRunner.runStep(StepRunner.java:225) at abbot.script.Sequence.runStep(Sequence.java:109) at abbot.script.Script.runStep(Script.java:511) at abbot.script.StepRunner.runStep(StepRunner.java:225) at abbot.script.StepRunner.run(StepRunner.java:172) at junit.extensions.abbot.ScriptFixture.runTest(ScriptFixture.java:28) at junit.extensions.abbot.ResolverFixture.runBare(ResolverFixture.java:86 ) at junit.extensions.abbot.ComponentTestFixture.runBare(ComponentTest Fixture.java:298) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D The last exception only happens sometime, so I can still hope that with the patches I have made I will get a succes-rate of 100%, after 4 or 6 runs. Niels -- Niels Stargardt PPI Financial Systems GmbH Hindenburgstra=DFe 49 22297 Hamburg Telefon: (040) 227433-323 Telefax: (040) 227433-333 Email : ja...@pp... |