本文介绍了()@ Win 7 Home Premium& amp;  Selenium 3.2.0在driver.quit()中崩溃了FireFox 52 GeckoDriver 0.14.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Win 7和FireFox是用德语运行的。赢7已经安装了所有可用的更新。相同的32位和64位GeckoDriver! (我的Win 7 ist 64位;我的FireFox是32位)。这只是我的电脑上的一个问题?



driver.quit()正在我的InternetExplorer没有问题。

  package JS_JFrame1; 

导入org.openqa.selenium.WebDriver;
导入org.openqa.selenium.firefox.FirefoxDriver;

public class SeleniumFireFoxMinimal1 {



public static void(String [] args)throws InterruptedException {

System .setProperty(webdriver.gecko.driver,e:\\geckodriver.exe);

WebDriver driver = new FirefoxDriver();

driver.get(http://www.toolsqa.com);

Thread.sleep(5000);

driver.quit();

$ b $ / code $ / pre
$ b $ p

其他像这样的Selenium命令可以很好地工作:
$ b $ pre $ element $ driver.findElement(By.id(sinp ));

System.out.println(找到的元素!);

element.clear();

element.sendKeys(black);

element.submit();

Eclipse控制台输出:

FireFox-Crash-Popup的硬拷贝:



在GitHub上报告:

当你说你的firefox崩溃的时候,如果这个弹出浏览器
Ť下面的解决方案为我工作。



  1. 转至此链接了解并下载Auto IT。基本上它允许你自动化Windows GUI。

  2. 您必须使用AutoIT创建一个exe文件,您将添加到您的selenium脚本来关闭弹出窗口。 阅读上面的链接如何下载并打开AutoIT脚本创建器。您可以创建自己的脚本或使用下面的脚本:

    ControlFocus(Firefox,,DirectUIHWND)
    ControlFocus(Firefox ,Button2)
    ControlClick(Firefox,,Button2) 编译一个exe文件并将其添加到您的项目。

  3. 运行以下脚本,即在使用driver.quit()方法之后运行以下脚本



    //);} catch(IOException e){
    System.out.println(无法关闭Firefox弹出);



  4. 希望这有助于。

    Win 7 and FireFox is running in German language. Win 7 has all available updates installed. Same for 32 and 64 Bit GeckoDriver! (my Win 7 ist 64 Bit; my FireFox is 32 Bit). Is this just a problem on my PC ?

    driver.quit() is working on my InternetExplorer without a problem.

    package JS_JFrame1;                                       
    
    import org.openqa.selenium.WebDriver;                     
    import org.openqa.selenium.firefox.FirefoxDriver;        
    
    public class SeleniumFireFoxMinimal1 {  
    
    
    
    public static void main(String[] args) throws InterruptedException {
    
        System.setProperty("webdriver.gecko.driver", "e:\\geckodriver.exe");
    
        WebDriver driver = new FirefoxDriver();                 
    
        driver.get("http://www.toolsqa.com");                    
    
        Thread.sleep(5000);                                   
    
        driver.quit();                                        
    
        }
    

    }

    Other Selenium commands like these work perfectly well:

    element = driver.findElement(By.id("sinp"));              
    
    System.out.println( "Element found!");                   
    
    element.clear();                                                
    
    element.sendKeys("black");                                      
    
    element.submit();                                                       
    

    Eclipse Console-Output:

    Hardcopy of the FireFox-Crash-Popup:

    https://www.dropbox.com/s/f3cuklcsgdbqcyx/FireFox_52_CrashPopup.PNG?dl=0

    Report at GitHub:

    https://github.com/mozilla/geckodriver/issues/517

    解决方案

    When you say your firefox crashes,if this the pop up that the browser gives FireFox has stopped working then the following solution worked for me.

    1. Go to this link http://www.guru99.com/use-autoit-selenium.html to know about and download Auto IT. Basically it allows you to automate windows GUI.
    2. You have to create an exe file using AutoIT which you will add to your selenium script to close the pop up.
    3. Read on the above link how to download and open AutoIT script creator. You can create your own script or use the one below :

      ControlFocus("Firefox","","DirectUIHWND") ControlFocus("Firefox","","Button2") ControlClick("Firefox","","Button2")

    4. Compile an exe and add it to your project.

    5. Run the following script in the end i.e. after you use the driver.quit() method

      try {Runtime.getRuntime().exec(System.getProperty("user.dir") + "//");} catch (IOException e) { System.out.println("Unable to close the Firefox pop up");

    Hope this helps.

    这篇关于()@ Win 7 Home Premium& amp;  Selenium 3.2.0在driver.quit()中崩溃了FireFox 52 GeckoDriver 0.14.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 01:46