How do I run Selenium in Xvfb?

前端 未结 5 1805
面向向阳花
面向向阳花 2020-11-22 08:21

I\'m on EC2 instance. So there is no GUI.

$pip install selenium
$sudo apt-get install firefox xvfb

Then I do this:

$Xvfb :1         


        
5条回答
  •  一整个雨季
    2020-11-22 09:14

    If you use Maven, you can use xvfb-maven-plugin to start xvfb before tests, run them using related DISPLAY environment variable, and stop xvfb after all.

提交回复
热议问题