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

[🐛 Bug]: Is it possible to run Selenium tests in headful mode using GitHub Actions? #14471

Closed
AshokKumarSMC opened this issue Sep 4, 2024 · 4 comments
Labels
I-question Applied to questions. Issues should be closed and send the user to community resources.

Comments

@AshokKumarSMC
Copy link

What happened?

I’m currently running Selenium test scripts using GitHub Actions, but the tests are executed in headless mode by default. I would like to know if it’s possible to run these tests in headful mode, where the browser is fully visible during the test execution.

Questions:

Is it possible to configure GitHub Actions to run Selenium tests in headful mode?
If yes, what are the steps or configurations required to achieve this?
Are there any limitations or considerations when running Selenium tests in headful mode on GitHub Actions?

Additional Information:

I am using the following setup:
Java (version 17)
Selenium WebDriver 
Maven
ChromeDriver

How can we reproduce the issue?

My goal is to:

Visually observe the browser interactions during the test runs.
Ensure that elements are correctly rendered and interacted with as they would be in a normal browser session.

Any guidance or examples would be greatly appreciated. Thank you for your support!

Relevant log output

NA

Operating System

Windows 11

Selenium version

4.17.0

What are the browser(s) and version(s) where you see this issue?

Chrome 128

What are the browser driver(s) and version(s) where you see this issue?

Version 128.0.6613.119 (Official Build) (64-bit)

Are you using Selenium Grid?

NO

Copy link

github-actions bot commented Sep 4, 2024

@AshokKumarSMC, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol diemol added I-question Applied to questions. Issues should be closed and send the user to community resources. and removed I-defect needs-triaging labels Sep 4, 2024
Copy link

github-actions bot commented Sep 4, 2024

💬 Please ask questions at:

@github-actions github-actions bot closed this as completed Sep 4, 2024
@dtopuzov
Copy link

dtopuzov commented Sep 4, 2024

Yes, it is possible.
On windows-latest it works out of the box, on ubuntu-latest runners you can use xvfb like that:
https://github.com/dtopuzov/sikuli-actions/blob/main/.github/workflows/gradle.yml#L41-L44

@AshokKumarSMC
Copy link
Author

Yes, it is possible. On windows-latest it works out of the box, on ubuntu-latest runners you can use xvfb like that: https://github.com/dtopuzov/sikuli-actions/blob/main/.github/workflows/gradle.yml#L41-L44

I have tried using xvfb during the "Build with Maven" step, but it still isn't working for me. In my Selenium test script, I removed the headless argument from the ChromeOptions as shown below:

ChromeOptions options = new ChromeOptions();
// options.addArguments("--headless"); // I have removed this line
driver = new ChromeDriver(options);

However, I still can't visually observe the browser interactions during the tests.

Is there something else I need to configure or check? Any advice on how to ensure the browser is displayed and the tests run in headful mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-question Applied to questions. Issues should be closed and send the user to community resources.
Projects
None yet
Development

No branches or pull requests

3 participants