繁体   English   中英

如何在Firefox的默认浏览器中运行Selenium

[英]How to run the selenium in default browser of firefox

我已经尝试过FirefoxProfile ,但是收到了异常-

线程“主”中的异常java.lang.OutOfMemoryError:Java堆空间。

使用以下代码-

ProfilesIni prf=new ProfilesIni();
FirefoxProfile profile=prf.getProfile("default-1453281235998");
WebDriver driver=new FirefoxDriver(profile);
driver.get("http://192.168.5.14/ames_1.3.0/login");
driver.findElement(By.id("txtUser")).sendKeys("XXX");
driver.findElement(By.id("txtPass")).sendKeys("XXX");
driver.findElement(By.xpath("//input[@value='LOGIN']")).click();
try{
        driver.findElement(By.id("act2")).click();
    }
 catch(NoSuchElementException ex)
 {
 }
driver.findElement(By.id("adminBannerLink_id")).click();
driver.findElement(By.id("BGMLink_id")).click();
driver.findElement(By.id("BSGMLink_id")).click();

java.lang.OutOfMemoryError:Java堆空间。 表示您的堆空间可能太小。 尝试使用java -Xms128m -Xmx1024m -jar selenium.jar。

JAVA OPTS请参阅: http : //www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM