私はこの方法を使って読んでいます
FileInputStream fi = new FileInputStream("C:\\Users\\GChaitanya.CHAINGANG\\Desktop\\2012_October_3PL_Unified_Template.xls");
Workbook w = Workbook.getWorkbook(fi);
s = w.getSheet(0);
そして、これを書く
WritableWorkbook wb = Workbook.createWorkbook(new File("D:\\output_2.xls"));
WritableSheet ws = wb.createSheet("customsheet", 1);
このエラーが発生します
org.openqa.selenium.StaleElementReferenceException: Element not found in the cache - perhaps the page has changed since it was looked up
Command duration or timeout: 100.10 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html
Build info: version: '2.34.0', revision: '11cd0ef', time: '2013-08-06 17:11:28'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_45'
Session ID: 60c039f3-60bb-413f-aca5-0543e074b04e
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=XP, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, browserConnectionEnabled=true, nativeEvents=true, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=24.0}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:79)
at gmailTest.TestLink.RealTime(TestLink.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
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.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Element not found in the cache - perhaps the page has changed since it was looked up
Build info: version: '2.34.0', revision: '11cd0ef', time: '2013-08-06 17:11:28'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_45'
Driver info: driver.version: unknown
at <anonymous class>.fxdriver.cache.getElementAt(resource://fxdriver/modules/web_element_cache.js:7642)
at <anonymous class>.Utils.getElementAt(file:///C:/Users/GCHAIT~1.CHA/AppData/Local/Temp/anonymous5288729173687770784webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:7231)
at <anonymous class>.fxdriver.preconditions.visible(file:///C:/Users/GCHAIT~1.CHA/AppData/Local/Temp/anonymous5288729173687770784webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:8228)
at <anonymous class>.DelayedCommand.prototype.checkPreconditions_(file:///C:/Users/GCHAIT~1.CHA/AppData/Local/Temp/anonymous5288729173687770784webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:10799)
at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///C:/Users/GCHAIT~1.CHA/AppData/Local/Temp/anonymous5288729173687770784webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:10816)
at <anonymous class>.fxdriver.Timer.prototype.setTimeout/<.notify(file:///C:/Users/GCHAIT~1.CHA/AppData/Local/Temp/anonymous5288729173687770784webdriver-profile/extensions/fxdriver@googlecode.com/components/command_processor.js:396)
これをデバッグモードで表示します
<terminated, exit value: 0>C:\Program Files\Java\jre7\bin\javaw.exe (Oct 29, 2013 5:12:25 PM)
コードは正常に動作していましたが、突然動作を停止し、10 レコードをほとんど読み取らず、クラッシュしました。少なくとも 300 ~ 400 件のレコードを読み取ることができました