Shows exception in java code (Selenium + Jsoup) -
i working on project. in that, have html page source code. that, invoke firefox driver using selenium
, , store page source code in string, , parse using jsoup
my code worked fine single url
. when put code in testing, has numbers of urls 1 one, @ end throws 1 exception, , project fails. please see exception , tell me why occurs, , give me solution overcome exception.
my selenium code follows,
private static firefoxprofile createfirefoxprofile() { file profiledir = new file("/tmp/firefox-profile-dir"); if (profiledir.exists()) { return new firefoxprofile(profiledir); } firefoxprofile firefoxprofile = new firefoxprofile(); file dir = firefoxprofile.layoutondisk(); try { profiledir.mkdirs(); fileutils.copydirectory(dir, profiledir); } catch (ioexception e) { e.printstacktrace(); } return firefoxprofile; }
// below code in main function (url1 , url2 2 urls )
webdriver driver = new firefoxdriver(createfirefoxprofile()); driver.get(url1); string hml1 = driver.getpagesource(); driver.get(url2); string hml2 = driver.getpagesource(); driver.close();
exception
[warning] java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.codehaus.mojo.exec.execjavamojo$1.run(execjavamojo.java:297) @ java.lang.thread.run(thread.java:662) caused by: org.openqa.selenium.webdriverexception: failed connect binary firefoxbinary(c:\program files (x86)\mozilla firefox\firefox.exe) on port 7056; process output follows: null build info: version: '2.31.0', revision: '1bd294d185a80fa4206dfeab80ba773c04ac33c0', time: '2013-02-27 13:51:26' system info: os.name: 'windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_43' driver info: driver.version: firefoxdriver @ org.openqa.selenium.firefox.internal.newprofileextensionconnection.start(newprofileextensionconnection.java:122) @ org.openqa.selenium.firefox.firefoxdriver.startclient(firefoxdriver.java:244) @ org.openqa.selenium.remote.remotewebdriver.<init>(remotewebdriver.java:110) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:188) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:183) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:179) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:96) @ xxx.yyy.zzz.template_matching.scroll_down.processing(scroll_down.java:334) @ xxx.yyy.zzz.template_matching.scroll_down.main(scroll_down.java:472) ... 6 more caused by: org.openqa.selenium.firefox.unabletocreateprofileexception: java.io.ioexception: there not enough space on disk build info: version: '2.31.0', revision: '1bd294d185a80fa4206dfeab80ba773c04ac33c0', time: '2013-02-27 13:51:26' system info: os.name: 'windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_43' driver info: driver.version: firefoxdriver @ org.openqa.selenium.firefox.firefoxprofile.layoutondisk(firefoxprofile.java:453) @ org.openqa.selenium.firefox.internal.newprofileextensionconnection.start(newprofileextensionconnection.java:77) ... 14 more caused by: java.io.ioexception: there not enough space on disk @ java.io.fileoutputstream.writebytes(native method) @ java.io.fileoutputstream.write(fileoutputstream.java:282) @ java.io.bufferedoutputstream.flushbuffer(bufferedoutputstream.java:65) @ java.io.bufferedoutputstream.write(bufferedoutputstream.java:109) @ org.openqa.selenium.io.zip.unzipfile(zip.java:171) @ org.openqa.selenium.io.zip.unzip(zip.java:152) @ org.openqa.selenium.io.filehandler.unzip(filehandler.java:54) @ org.openqa.selenium.firefox.internal.fileextension.obtainrootdirectory(fileextension.java:81) @ org.openqa.selenium.firefox.internal.fileextension.writeto(fileextension.java:58) @ org.openqa.selenium.firefox.internal.classpathextension.writeto(classpathextension.java:63) @ org.openqa.selenium.firefox.firefoxprofile.installextensions(firefoxprofile.java:469) @ org.openqa.selenium.firefox.firefoxprofile.layoutondisk(firefoxprofile.java:447) ... 15 more [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 20:49:03.625s [info] finished at: thu apr 18 10:47:12 ist 2013 [info] final memory: 12m/163m [info] ------------------------------------------------------------------------ [error] failed execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project template_matching: exception occured while executing java class. null: invocationtargetexception: failed connect binary firefoxbinary(c:\program files (x86)\mozilla firefox\firefox.exe) on port 7056; process output follows: [error] null [error] build info: version: '2.31.0', revision: '1bd294d185a80fa4206dfeab80ba773c04ac33c0', time: '2013-02-27 13:51:26' [error] system info: os.name: 'windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_43' [error] driver info: driver.version: firefoxdriver: java.io.ioexception: there not enough space on disk [error] build info: version: '2.31.0', revision: '1bd294d185a80fa4206dfeab80ba773c04ac33c0', time: '2013-02-27 13:51:26' [error] system info: os.name: 'windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_43' [error] driver info: driver.version: firefoxdriver [error] -> [help 1] [error] [error] see full stack trace of errors, re-run maven -e switch. [error] re-run maven using -x switch enable full debug logging. [error] [error] more information errors , possible solutions, please read following articles: [error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojoexecutionexception
you work on usb flashdrive or sd card. check out hard disk free space , if aren't working on peripheral.
Comments
Post a Comment