1

I am running following code in PyCharm

from selenium import webdriver

driver = webdriver.Firefox

Scripts executes successfully with following message in console

C:\Python34\python.exe C:/Users/dev/PycharmProjects/PYLearn/firs_selenium_script.py

Process finished with exit code 0

But Firefox Browser is not opening, I have selenium installed using pip, Do I need additional setting to make this work.

Thanks,

2 Answers 2

1

To launch the browser your code should look like:

from selenium import webdriver

browser = webdriver.Firefox()
browser.get('http://your-url')

After the test you will want the close the browser, so add:

self.browser.quit()

Hope this solve your problem.

More info: http://selenium-python.readthedocs.org/getting-started.html

Sign up to request clarification or add additional context in comments.

Comments

0

Go to Python Console at the bottom and run your commands and check the error

You can try this:

from selenium import webdriver

browser = webdriver.Chrome()

Browser should be opened , anyways check whether the browser started running or not.

Once, your browser fully loaded, your command will move to next line

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.