When executed below selenium-python code from python IDLE chrome launches gmail.com successfully. Where as when executed from PyDev(Eclipse) chrome launches gmail.com and browser is closed immediately.Please advice what could be the issue and probable solution
from selenium import webdriver
import os
class pySelChrome():
'''
classdocs
'''
def openChrome(self):
'''
Constructor
'''
chromeDriverPath = "/Users/XX/Documents/workspace/PySelenium/pySelPack/chromedriver"
os.environ["webdriver.chrome.driver"]=chromeDriverPath
os.environ["webdriver.chrome.driver"]="/Users/XX/Documents/workspace/PySelenium/pySelPack/chromedriver"
driver = webdriver.Chrome(chromeDriverPath)
driver.get("http://gmail.com")
driver.implicitly_wait(30)
driver.fullscreen_window()
return driver
psc = pySelChrome()
psc.openChrome()
But the same code without class definition works fine in PyDev(Eclipse).
from selenium import webdriver
import os
chromeDriverPath = "/Users/XX/Documents/workspace/PySelenium/pySelPack/chromedriver"
os.environ["webdriver.chrome.driver"]=chromeDriverPath
os.environ["webdriver.chrome.driver"]="/Users/XX/Documents/workspace/PySelenium/pySelPack/chromedriver"
driver = webdriver.Chrome(chromeDriverPath)
driver.get("http://gmail.com")
driver.implicitly_wait(30)
driver.fullscreen_window()