硒服务器导致Firefox崩溃 [英] Selenium server causing firefox to crash

查看:466
本文介绍了硒服务器导致Firefox崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前问题



我每天晚上都运行自动化的selenium脚本。我只注意到,Firefox 38崩溃,没有任何东西被列入Firefox的日志。



点击重新启动Firefox意味着测试运行良好。

有没有办法调试和查找firefox崩溃是怎么回事?

Firefox错误报告: 的https:// crash- stats.mozilla.com/report/index/fdba810a-1980-45ea-b64b-0e8c62150604
<br/

当前解决方案



因为已经选择了重新启动Firefox,所以使用xdotool通过发送回车键点击该按钮。 (注意:设置适当的显示, export DISPLAY =:1 )。我正在执行cron的bash脚本,它包含以下代码段:
$ b $ $ p $ export $ JAVA_HOME = / usr / lib / jvm / Java的7-的OpenJDK-AMD64
出口PATH = $ PATH:/ usr / lib中/ JVM / Java的7-的OpenJDK,AMD64 /斌
出口显示器= 99
爪哇 - 罐子/home/m/selenium-server-standalone-2.45.0.jar -htmlSuite *火狐 http://www.google.com 硒/ 2_Suite.html test_results / 2_results.htm &安培;

sleep 5
xdotool key KP_Enter
wait



Update



除了模拟回车键来重新启动firefox并运行测试之外,我使用 https://support.mozilla.org/en-US/questions/1003777

解决方案

我有.NET绑定的问题。我从来没有解决它,但我有一个解决方法。

我发现从现有的配置文件实例化Selenium Firefox驱动程序时没有发生问题,所以我的解决方法是要创建一个空白的配置文件,使用该配置文件的临时副本启动Selenium的Firefox驱动程序;然后在测试结束时删除临时副本。

通过这种方式,您仍然使用一个合理的新的配置文件,并且重要的是相同 profile,用于每个测试。

Selenium文档在用现有的配置文件启动Firefox驱动程序


Current Problem

I'm running automated selenium scripts every night. I just noticed that Firefox 38 is crashing and nothing is being listed in the firefox logs.

Clicking "Restart" firefox means that the tests run fine.

Is there anyway to debug and find what is going on with firefox crashing?

Firefox error report: https://crash-stats.mozilla.com/report/index/fdba810a-1980-45ea-b64b-0e8c62150604

Current Solution

Since "Restart Firefox" is already selected, using xdotool this button is clicked by sending the enter key. (note: set appropriate display, export DISPLAY=:1). I am executing a bash script from cron that contains the following section of code:

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH=$PATH:/usr/lib/jvm/java-7-openjdk-amd64/bin
export DISPLAY=":99"    
java -jar /home/m/selenium-server-standalone-2.45.0.jar -htmlSuite "*firefox" "http://www.google.com" "selenium/2_Suite.html" "test_results/2_results.htm" &

sleep 5
xdotool key KP_Enter
wait 

Update

Except for simulating the enter key to restart firefox and run the tests, I'v disabled all future updates on my headless automated testing VM using https://support.mozilla.org/en-US/questions/1003777 .

解决方案

I had this issue with the .NET bindings. I never solved it, but I have a workaround.

I found that the issue didn't occur when instantiating the Selenium Firefox driver from an existing profile, so my workaround was to create a blank profile, launch Selenium's Firefox driver using a temporary copy of that profile; then at the conclusion of the test, delete the temporary copy.

In this way, you're still using a reasonably-fresh profile, and importantly the same profile, for every test.

The Selenium documentation has instructions on launching the Firefox driver with an existing profile.

这篇关于硒服务器导致Firefox崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆