File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -2816,10 +2816,15 @@ def setUp(self):
2816
2816
self .testcase_manager .insert_testcase_data (data_payload )
2817
2817
self .case_start_time = int (time .time () * 1000 )
2818
2818
if self .headless :
2819
- from pyvirtualdisplay import Display
2820
- self .display = Display (visible = 0 , size = (1920 , 1200 ))
2821
- self .display .start ()
2822
- self .headless_active = True
2819
+ try :
2820
+ from pyvirtualdisplay import Display
2821
+ self .display = Display (visible = 0 , size = (1920 , 1200 ))
2822
+ self .display .start ()
2823
+ self .headless_active = True
2824
+ except Exception :
2825
+ # pyvirtualdisplay might not be necessary anymore because
2826
+ # Chrome and Firefox now have built-in headless displays
2827
+ pass
2823
2828
2824
2829
# Launch WebDriver for both Pytest and Nosetests
2825
2830
if not hasattr (self , "browser" ):
You can’t perform that action at this time.
0 commit comments