1

I am using selenium while running selenium code i am getting error:

WebDriverException: Message: 'The browser appears to have exited before we could connect. The output was: Error: cannot open display: IP:192.168.72.112\n'

I am running my code through putty, as there is no display in putty.. i have used the concept of virtualdisplay and install "pyvirtualdisplay" module.. Before running the script i have the below command:

export DISPLAY='IP:191.168.72.112'

but still am not able to run... Please help me and suggest me, what am i doing wrong?

Python selenium code:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
import unittest, time, re
from pyvirtualdisplay import Display

class PSeleTry1(unittest.TestCase):
    def setUp(self):
        display = Display(visible=0, size=(1024, 768))
        display.start()
        self.driver = webdriver.Firefox()
        self.driver.implicitly_wait(30)
        self.base_url = "http://www.example.com/"
        ......
        .....// remaining code generated by selenium ide//
Surya Gupta
  • 125
  • 7

0 Answers0