Class BrowserWebDriverContainer

java.lang.Object
org.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
org.testcontainers.selenium.BrowserWebDriverContainer
All Implemented Interfaces:
AutoCloseable, org.testcontainers.containers.Container<BrowserWebDriverContainer>, org.testcontainers.containers.ContainerState, org.testcontainers.containers.traits.LinkableContainer, org.testcontainers.containers.wait.strategy.WaitStrategyTarget, org.testcontainers.lifecycle.Startable, org.testcontainers.lifecycle.TestLifecycleAware

public class BrowserWebDriverContainer extends org.testcontainers.containers.GenericContainer<BrowserWebDriverContainer> implements org.testcontainers.lifecycle.TestLifecycleAware
A chrome/firefox/custom container based on SeleniumHQ's standalone container sets.

Supported images: selenium/standalone-chrome, selenium/standalone-firefox, selenium/standalone-edge, selenium/standalone-chrome-debug, selenium/standalone-firefox-debug

Exposed ports: 4444

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     

    Nested classes/interfaces inherited from interface org.testcontainers.containers.Container

    org.testcontainers.containers.Container.ExecResult
  • Field Summary

    Fields inherited from class org.testcontainers.containers.GenericContainer

    CONTAINER_RUNNING_TIMEOUT_SEC, dependencies, dockerClient, INTERNAL_HOST_HOSTNAME, waitStrategy

    Fields inherited from interface org.testcontainers.containers.ContainerState

    STATE_HEALTHY
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor taking a specific webdriver container name and tag
    BrowserWebDriverContainer(org.testcontainers.utility.DockerImageName dockerImageName)
    Constructor taking a specific webdriver container name and tag
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterTest(org.testcontainers.lifecycle.TestDescription description, Optional<Throwable> throwable)
     
    protected void
     
    protected void
    containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
     
    protected @NotNull Set<Integer>
     
     
     
    void
     
     
    withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode, File vncRecordingDirectory)
     
    withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode, File vncRecordingDirectory, org.testcontainers.containers.VncRecordingContainer.VncRecordingFormat recordingFormat)
     

    Methods inherited from class org.testcontainers.containers.GenericContainer

    addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, containerIsCreated, containerIsStarted, containerIsStarting, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPortNumbers, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setContainerDef, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, toString, waitingFor, waitUntilContainerStarted, withAccessToHost, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCopyToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectory

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.testcontainers.containers.Container

    addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBind

    Methods inherited from interface org.testcontainers.containers.ContainerState

    copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunning

    Methods inherited from interface org.testcontainers.lifecycle.Startable

    close

    Methods inherited from interface org.testcontainers.lifecycle.TestLifecycleAware

    beforeTest
  • Constructor Details

    • BrowserWebDriverContainer

      public BrowserWebDriverContainer(String dockerImageName)
      Constructor taking a specific webdriver container name and tag
      Parameters:
      dockerImageName - Name of the selenium docker image
    • BrowserWebDriverContainer

      public BrowserWebDriverContainer(org.testcontainers.utility.DockerImageName dockerImageName)
      Constructor taking a specific webdriver container name and tag
      Parameters:
      dockerImageName - Name of the selenium docker image
  • Method Details

    • getLivenessCheckPorts

      @NotNull protected @NotNull Set<Integer> getLivenessCheckPorts()
      Overrides:
      getLivenessCheckPorts in class org.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
    • configure

      protected void configure()
      Overrides:
      configure in class org.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
    • getSeleniumAddress

      public URL getSeleniumAddress()
    • getVncAddress

      public String getVncAddress()
    • containerIsStarted

      protected void containerIsStarted(com.github.dockerjava.api.command.InspectContainerResponse containerInfo)
      Overrides:
      containerIsStarted in class org.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
    • afterTest

      public void afterTest(org.testcontainers.lifecycle.TestDescription description, Optional<Throwable> throwable)
      Specified by:
      afterTest in interface org.testcontainers.lifecycle.TestLifecycleAware
    • stop

      public void stop()
      Specified by:
      stop in interface org.testcontainers.lifecycle.Startable
      Overrides:
      stop in class org.testcontainers.containers.GenericContainer<BrowserWebDriverContainer>
    • withRecordingMode

      public BrowserWebDriverContainer withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode, File vncRecordingDirectory)
    • withRecordingMode

      public BrowserWebDriverContainer withRecordingMode(BrowserWebDriverContainer.VncRecordingMode recordingMode, File vncRecordingDirectory, org.testcontainers.containers.VncRecordingContainer.VncRecordingFormat recordingFormat)
    • withRecordingFileFactory

      public BrowserWebDriverContainer withRecordingFileFactory(RecordingFileFactory recordingFileFactory)