ChromeBrowser Launches successfully from python IDE but it does not when executed from eclipse(pydev

19 views
Skip to first unread message

deal...@gmail.com

unread,
Jan 26, 2018, 12:34:10 AM1/26/18
to Selenium Users
https://stackoverflow.com/questions/48456161/selenium-python-chromebrowser-launch-works-when-executed-in-python-ide-but-it-do

  1. Operating System: Mac OSX EL Capitan
  2. Eclipse Neon.3 Release (4.6.3)
  3. Python Interpreter: 3.6
  4. Chrome Version: 63.0.3239.132
  5. Chrome Driver Version: ChromeDriver 2.35

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()
Reply all
Reply to author
Forward
0 new messages