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

[Research] Visualize Browser Interactions for Selenium Tests with Docker #3700

Closed
Tracked by #2491
ananzh opened this issue Mar 27, 2023 · 2 comments
Closed
Tracked by #2491

Comments

@ananzh
Copy link
Member

ananzh commented Mar 27, 2023

When running Selenium tests in a Docker environment, it can be challenging to visualize browser interactions and debug the test cases.

Objective: Provide an easy debug environment for contributors to run Selenium tests by visualizing browser interactions when the application is hosted in Docker.

@ananzh ananzh self-assigned this Mar 27, 2023
@ananzh ananzh changed the title Setup a test env for Selenium using docker [Research] Visualize Browser Interactions for Selenium Tests with Docker Mar 27, 2023
@ananzh
Copy link
Member Author

ananzh commented Mar 27, 2023

Introduction

When running Selenium tests in a Docker environment, it can be challenging to visualize browser interactions and debug the test cases. One solution to this problem is to use VNC (Virtual Network Computing) to enable remote access to the container's graphical environment. This proposal outlines the process of setting up VNC for visualizing browser interactions during Selenium test execution in Docker.

Why choose VNC

VNC allows remote access to the container's graphical environment, enabling users to visualize browser interactions during Selenium test execution. This makes it easier to debug and understand the test cases. Other options include:

  • DCV (NICE Desktop Cloud Visualization): DCV provides high-performance remote access to 2D/3D applications, but it requires additional setup and configuration.
  • Running tests in headless mode: This is more resource-efficient, but it doesn't allow for visualization of browser interactions.

We choose VNC for this proposal because it provides a balance between ease of setup and the ability to visualize browser interactions.

@ananzh
Copy link
Member Author

ananzh commented Mar 27, 2023

LXDE

Besides VNC, we should also consider to add desktop environments. We use Openbox and LXDE as lightweight desktop environments for the Docker container. Using LXDE can make it easier to debug the VNC connection issue because it provides a more complete and visually rich desktop environment. LXDE includes a panel, icons, and menus that should provide better visual feedback when connect to the container with a VNC viewer. During the research, I tried three options

  • No LXDE or any desktop env manager: I see black VNC viewer. No terminal. Very hard to debug.
  • LXDE complete: I initially considered using LXDE, but it is quite big. I have installation issue. First of all install LXDE is pain and it needs a lot of time. The build process is stuck at adding users to the "netdev" group, which is part of the installation of LXDE. It might just need more time to complete. But I think this is not a very efficient option so I didn't wait it to complete.
  • Fluxbox: Fluxbox window manager is light weighted, but it doesn't work well. The menu in Fluxbox doesn't work and I can't find a terminal.
  • LXDE-core: Finally, I switched to install only the essential components needed for a basic LXDE desktop environment. Replace the lxde package with lxde-core. It installs quickly and I am able to see a menu and a terminal.

Files and setup explanation

The implementation of the proposal would request the following setup:

  • Dockerfile.selenium: Installs Google Chrome, xvfb (X virtual framebuffer), x11vnc (VNC server for X), openbox (a lightweight window manager), lxde-core (a lightweight desktop environment), and other dependencies. We chose lxde-core due to its minimal resource usage and compatibility with VNC.

  • entrypoint.sh: Just need to update it to start the VNC server by running the start-vnc.sh script.

  • start-vnc.sh: This script sets up the VNC server, configures the display, and starts the LXDE desktop environment.

  • docker-compose.selenium.yml: This file defines a Docker Compose service for running the Selenium tests with VNC support. It specifies the Dockerfile.selenium file to build the image, maps the VNC port (5900) to the host, and sets the required environment variables.

ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Mar 30, 2023
…ests

This PR introduces new Docker files to enable debugging of Selenium
functional tests for Docker users. It configures a VNC viewer for
real-time browser interaction monitoring during test execution.

Additionally, a new section is added to the documentation detailing
the process of running and debugging Selenium functional tests
using Docker and a VNC viewer.

Issue Resolve
opensearch-project#3700

Signed-off-by: Anan Zhuang <[email protected]>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Mar 30, 2023
…ests

This PR introduces new Docker files to enable debugging of Selenium
functional tests for Docker users. It configures a VNC viewer for
real-time browser interaction monitoring during test execution.

Additionally, a new section is added to the documentation detailing
the process of running and debugging Selenium functional tests
using Docker and a VNC viewer.

Issue Resolve
opensearch-project#3700

Signed-off-by: Anan Zhuang <[email protected]>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Mar 30, 2023
…ests

This PR introduces new Docker files to enable debugging of Selenium
functional tests for Docker users. It configures a VNC viewer for
real-time browser interaction monitoring during test execution.

Additionally, a new section is added to the documentation detailing
the process of running and debugging Selenium functional tests
using Docker and a VNC viewer.

Issue Resolve
opensearch-project#3700

Signed-off-by: Anan Zhuang <[email protected]>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Mar 30, 2023
…ests

This PR introduces new Docker files to enable debugging of Selenium
functional tests for Docker users. It configures a VNC viewer for
real-time browser interaction monitoring during test execution.

Additionally, a new section is added to the documentation detailing
the process of running and debugging Selenium functional tests
using Docker and a VNC viewer.

Issue Resolve
opensearch-project#3700

Signed-off-by: Anan Zhuang <[email protected]>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Mar 30, 2023
…ests

This PR introduces new Docker files to enable debugging of Selenium
functional tests for Docker users. It configures a VNC viewer for
real-time browser interaction monitoring during test execution.

Additionally, a new section is added to the documentation detailing
the process of running and debugging Selenium functional tests
using Docker and a VNC viewer.

Issue Resolve
opensearch-project#3700

Signed-off-by: Anan Zhuang <[email protected]>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Apr 17, 2023
This PR introduces new Docker files to enable debugging of Selenium
functional tests for Docker users. It configures a VNC viewer for
real-time browser interaction monitoring during test execution.

Additionally, a new section is added to the documentation detailing
the process of running and debugging Selenium functional tests
using Docker and a VNC viewer.

Issue Resolve
opensearch-project#3700

Signed-off-by: Anan Zhuang <[email protected]>
@ananzh ananzh closed this as completed in e4fccfc Apr 17, 2023
opensearch-trigger-bot bot pushed a commit that referenced this issue Apr 17, 2023
This PR introduces new Docker files to enable debugging of Selenium
functional tests for Docker users. It configures a VNC viewer for
real-time browser interaction monitoring during test execution.

Additionally, a new section is added to the documentation detailing
the process of running and debugging Selenium functional tests
using Docker and a VNC viewer.

Issue Resolve
#3700

Signed-off-by: Anan Zhuang <[email protected]>
(cherry picked from commit e4fccfc)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ananzh pushed a commit that referenced this issue Apr 17, 2023
…) (#3866)

This PR introduces new Docker files to enable debugging of Selenium
functional tests for Docker users. It configures a VNC viewer for
real-time browser interaction monitoring during test execution.

Additionally, a new section is added to the documentation detailing
the process of running and debugging Selenium functional tests
using Docker and a VNC viewer.

Issue Resolve
#3700


(cherry picked from commit e4fccfc)

Signed-off-by: Anan Zhuang <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
sikhote pushed a commit to sikhote/OpenSearch-Dashboards that referenced this issue Apr 24, 2023
…nsearch-project#3747)

This PR introduces new Docker files to enable debugging of Selenium
functional tests for Docker users. It configures a VNC viewer for
real-time browser interaction monitoring during test execution.

Additionally, a new section is added to the documentation detailing
the process of running and debugging Selenium functional tests
using Docker and a VNC viewer.

Issue Resolve
opensearch-project#3700

Signed-off-by: Anan Zhuang <[email protected]>
Signed-off-by: David Sinclair <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant