muchachos tengo un problema <code>import unittest from pyunitreport import HTMLTestRunner from selenium import webdriver class helloword...

Pregunta de la clase:
¡Hola, mundo!
Darían Rafael Sánchez Muñoz

Darían Rafael Sánchez Muñoz

Pregunta
studenthace 4 años

muchachos tengo un problema

import unittest from pyunitreport import HTMLTestRunner from selenium import webdriver class helloword(unittest.TestCase): def setUp(self): self.driver = webdriver.chrome(executable_path = r'C:\Users\Usuario\Desktop\curso selenium\chromedriver.exe') driver = self.driver driver.implicity_wait(10) def test_hello_world(self): driver = self.driver driver.get('https://www.platzi.com') def tearDown(self): self.driver.quit() if __name__ == "__main__": unittest.main(verbosity=2, testRunner= HTMLTestRunner(output='reportes', report_name ='hello_word_report'))```

<h3>Running tests…</h3> test_hello_world (main.helloword) … ERROR (0.000996)s

<h3>======================================================================

ERROR [0.000996s]: b’test_hello_world (main.helloword)’</h3> Traceback (most recent call last):

File “c:\Users\Usuario\Desktop\curso selenium\hello_word.py”, line 8, in setUp

TypeError: ‘module’ object is not callable


Ran 1 test in 0.008s

FAILED

(Errors=1)

Generating HTML reports…

Template is not specified, load default template instead.

Reports generated: C:\Users\Usuario\Desktop\curso selenium\reports\reportes\hello_word_report.html```

1 respuestas
para escribir tu comentario
    Jose David Ballesteros Paternina

    Jose David Ballesteros Paternina

    studenthace 4 años

    Hola, Tienes un problema de Typo en la linea 8

    self.driver = webdriver.chrome(executable_path = r'C:\Users\Usuario\Desktop\curso selenium\chromedriver.exe')

    En la parte de webdriver.chrome, chrome tiene que ir con la C mayuscula:

    self.driver = webdriver.Chrome(executable_path = r'C:\Users\Usuario\Desktop\curso selenium\chromedriver.exe')

    PD: Es recomendable tener el archivo de chromedriver.exe en la carpeta en donde se encuentra almacenada tu proyecto.

    Espero haberte ayudado!

Curso de Introducción a Selenium con Python [Empieza Gratis]

Curso de Introducción a Selenium con Python [Empieza Gratis]

Selenium es un framework de automatización de navegadores multilenguaje. Con él podrás simular las acciones de tus usuarios dentro de aplicaciones web con fines de testing, generar los reportes correspondientes, automatizar tareas repetitivas e incluso extraer datos de la web. Cualquier acción humana puede ser replicada y serás capaz de programarla.

Curso de Introducción a Selenium con Python [Empieza Gratis]

Curso de Introducción a Selenium con Python [Empieza Gratis]

Selenium es un framework de automatización de navegadores multilenguaje. Con él podrás simular las acciones de tus usuarios dentro de aplicaciones web con fines de testing, generar los reportes correspondientes, automatizar tareas repetitivas e incluso extraer datos de la web. Cualquier acción humana puede ser replicada y serás capaz de programarla.