1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Headless in Pycharm doesnt work on background

Discussão em 'Python' iniciado por Stack, Setembro 8, 2025.

  1. Stack

    Stack Membro Participativo

    Im learning auto tests in python and in one Video guy using Mozilla for tests. And he uses

    import pytest
    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options


    @pytest.fixture()
    def browser():
    options = Options()
    options.add_argument('--headless')
    browser = webdriver.Chrome(options=options)
    browser.maximize_window()
    browser.implicitly_wait(3)
    yield browser
    browser.close()


    I dont have mozilla and I try to use Edge or Chrome. At this code its Chrome. When I run that code it still Opens the Browser instead of running it on background... I tried google or chatgpt somehow and cant find answer ... any help ?

    I tried Edge and Chrome and it doesnt matter what I did still same result. Tried to change argument to disable gpu.. didnt help.

    I want to run it on Edge since Chrome gives me error for some reason when I try to run pytest but edge doesnt.

    Continue reading...

Compartilhe esta Página