Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The print statements are not appearing in console #85

Open
axvargas opened this issue Jun 10, 2021 · 0 comments
Open

The print statements are not appearing in console #85

axvargas opened this issue Jun 10, 2021 · 0 comments

Comments

@axvargas
Copy link

  • HtmlTestRunner version: 1.2.1
  • Python version: 3.9
  • Operating System: Windows 10

Description

I was using the library to practice test cases, but then I realize that the print statements were no appearing
This is my code:
`
from unittest import TestCase, main
from HtmlTestRunner import HTMLTestRunner
from selenium import webdriver

class AddRemoveElements(TestCase):

@classmethod
def setUpClass(cls):
    cls.driver = webdriver.Chrome(executable_path='./chromedriver.exe')
    driver = cls.driver
    driver.implicitly_wait(10)
    driver.maximize_window()
    driver.get("http://the-internet.herokuapp.com")
    driver.find_element_by_link_text('Disappearing Elements').click()

def test_name_elements(self):
    driver = self.driver
    options = []
    no_options = 5
    tries = 1

    while len(options) < 5:
        options.clear()
        for i in range(no_options):
            try:
                option_name = driver.find_element_by_xpath(f'//ul/li[{i+1}]/a')
                options.append(option_name.text)
                print(options)
            except:
                print(f'Option number {i+1} was NOT FOUND')
                tries += 1
                driver.refresh()
    
    print(f'Finished in {tries} tries')

@classmethod
def tearDownClass(cls):
    cls.driver.implicitly_wait(5)
    cls.driver.quit()

if name == "main":
main(verbosity=2, testRunner=HTMLTestRunner(
output="reports/dinamic_elements", report_name="test_dinamic_elements", add_timestamp=False))
`

What I Did

As you can see, I have some print statements, but in the console I am not getting them in the console

image

My expected result is

image

As you can see here, the print statements appear in console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant