google chrome - Python: What modules do I need to include in the directory of my program to run Selenium with Unittest? -
I am trying to run the following code using Pycharm IDE:
selenium import selenium.webdriver.common.keys linked to import webdriver import key category PythonOrgSearch (unittest.TestCase): def setup (self): self.driver = webdriver.Firefox () def Test_search_in_python_org (self): driver = self.driver driver.get ( "http://www.python.org") self.assertIn ( "dragon", driver.title) ELEM = driver.find_element_by_name ( "q") elem.send_keys ( "selenium") elem.send_keys ( Keys.RETURN) def teardown (self): self.driver.close () if __name__ == "__main__": unittest.main () I Nimnliki Error comes when I do:
Traceback (most recent call last): File "/ Users / BigRed / PycharmProjects / Dragon 3 / source.py", line 8, setup self.driver = webdriver.Firefox no specialty) AttributeError: 'module' object ( 'Firefox' the directory of the source file, I also have selenium folder in which t he Vebdraivr files , As well as exceptions and selenium.py . Is there something I am missing? Or is the problem completely different? Thank you for your help.
I also faced the same problem and I did this way
1) Open Terminal (Ctrl + Alt + T) 2) Check $ Python --version 3) Now install Firefox using Pip or sudo apt-get or
1) check the open terminal (Ctrl + Alt + T) 2) $ python - return (2.7.5 ....) and 3) visiting project interpreter picture Select the same Python version as a project interpreter 4) Now run it Ga.
Comments
Post a Comment