Class CustomHttpCommandExecutor
- java.lang.Object
-
- org.openqa.selenium.remote.HttpCommandExecutor
-
- io.testproject.sdk.internal.helpers.CustomHttpCommandExecutor
-
- All Implemented Interfaces:
ReportingCommandsExecutor
,org.openqa.selenium.logging.NeedsLocalLogs
,org.openqa.selenium.remote.CommandExecutor
public final class CustomHttpCommandExecutor extends org.openqa.selenium.remote.HttpCommandExecutor implements ReportingCommandsExecutor
A custom commands executor for Selenium drivers. Extends the original functionality by restoring driver session initiated by the Agent. Reports commands executed to Agent.
-
-
Field Summary
-
Fields inherited from interface io.testproject.sdk.internal.helpers.ReportingCommandsExecutor
LOG, STATE_SUCCESS
-
-
Constructor Summary
Constructors Constructor Description CustomHttpCommandExecutor(AgentClient agentClient, java.net.URL addressOfRemoteServer)
Initializes a new instance of this an Executor restoring command/response codecs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openqa.selenium.remote.Response
execute(org.openqa.selenium.remote.Command command)
org.openqa.selenium.remote.Response
execute(org.openqa.selenium.remote.Command command, boolean skipReporting)
Extended command execution method.AgentClient
getAgentClient()
Getter forAgentClient
instance.java.util.concurrent.atomic.AtomicReference<java.lang.String>
getCurrentTest()
Getter for CURRENT_TEST field.io.testproject.sdk.internal.helpers.StashedCommands
getStashedCommands()
Getter for stashed commands hashmap.boolean
isCommandReportsDisabled()
Getter for commandReportsDisabled field.boolean
isRedactionDisabled()
Getter forredactionDisabled
field.boolean
isReportsDisabled()
Getter forreportsDisabled
field.boolean
isTestAutoReportsDisabled()
Getter fortestReportsDisabled
field.void
setCommandReportsDisabled(boolean disable)
Setter for commandReportsDisabled field.void
setRedactionDisabled(boolean disable)
Setter forredactionDisabled
field.void
setReportsDisabled(boolean disable)
Setter forreportsDisabled
field.void
setTestAutoReportsDisabled(boolean disable)
Setter fortestReportsDisabled
field.-
Methods inherited from class org.openqa.selenium.remote.HttpCommandExecutor
defineCommand, getAddressOfRemoteServer, setLocalLogs
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.testproject.sdk.internal.helpers.ReportingCommandsExecutor
clearStash, extractResponse, inferTestName, reportCommand, reportCommand, reportTest
-
-
-
-
Constructor Detail
-
CustomHttpCommandExecutor
public CustomHttpCommandExecutor(AgentClient agentClient, java.net.URL addressOfRemoteServer)
Initializes a new instance of this an Executor restoring command/response codecs.- Parameters:
agentClient
- an instance ofAgentClient
used to pen the original driver session.addressOfRemoteServer
- URL of the remote Selenium server managed by the Agent
-
-
Method Detail
-
execute
public org.openqa.selenium.remote.Response execute(org.openqa.selenium.remote.Command command) throws org.openqa.selenium.WebDriverException
- Specified by:
execute
in interfaceorg.openqa.selenium.remote.CommandExecutor
- Overrides:
execute
in classorg.openqa.selenium.remote.HttpCommandExecutor
- Throws:
org.openqa.selenium.WebDriverException
-
execute
public org.openqa.selenium.remote.Response execute(org.openqa.selenium.remote.Command command, boolean skipReporting)
Extended command execution method. Allows skipping reporting for "internal" commands, for example: - Taking screenshot for manual step reporting. - Inspecting element type to determine whether redaction is required.- Specified by:
execute
in interfaceReportingCommandsExecutor
- Parameters:
command
- Command to executeskipReporting
- Flag to control reporting- Returns:
- Command execution response.
-
getAgentClient
public AgentClient getAgentClient()
Description copied from interface:ReportingCommandsExecutor
Getter forAgentClient
instance.- Specified by:
getAgentClient
in interfaceReportingCommandsExecutor
- Returns:
- value of
AgentClient
field
-
getStashedCommands
public io.testproject.sdk.internal.helpers.StashedCommands getStashedCommands()
Description copied from interface:ReportingCommandsExecutor
Getter for stashed commands hashmap.- Specified by:
getStashedCommands
in interfaceReportingCommandsExecutor
- Returns:
- value of stashed commands hashmap.
-
isReportsDisabled
public boolean isReportsDisabled()
Getter forreportsDisabled
field.- Specified by:
isReportsDisabled
in interfaceReportingCommandsExecutor
- Returns:
- value of
reportsDisabled
field
-
setReportsDisabled
public void setReportsDisabled(boolean disable)
Setter forreportsDisabled
field.- Specified by:
setReportsDisabled
in interfaceReportingCommandsExecutor
- Parameters:
disable
- True to disable or False to enable.
-
isCommandReportsDisabled
public boolean isCommandReportsDisabled()
Description copied from interface:ReportingCommandsExecutor
Getter for commandReportsDisabled field.- Specified by:
isCommandReportsDisabled
in interfaceReportingCommandsExecutor
- Returns:
- value of commandReportsDisabled field
-
setCommandReportsDisabled
public void setCommandReportsDisabled(boolean disable)
Description copied from interface:ReportingCommandsExecutor
Setter for commandReportsDisabled field.- Specified by:
setCommandReportsDisabled
in interfaceReportingCommandsExecutor
- Parameters:
disable
- True to disable or False to enable.
-
isTestAutoReportsDisabled
public boolean isTestAutoReportsDisabled()
Getter fortestReportsDisabled
field.- Specified by:
isTestAutoReportsDisabled
in interfaceReportingCommandsExecutor
- Returns:
- value of
testReportsDisabled
field
-
setTestAutoReportsDisabled
public void setTestAutoReportsDisabled(boolean disable)
Setter fortestReportsDisabled
field.- Specified by:
setTestAutoReportsDisabled
in interfaceReportingCommandsExecutor
- Parameters:
disable
- True to disable or False to enable.
-
isRedactionDisabled
public boolean isRedactionDisabled()
Getter forredactionDisabled
field.- Specified by:
isRedactionDisabled
in interfaceReportingCommandsExecutor
- Returns:
- value of
redactionDisabled
field
-
setRedactionDisabled
public void setRedactionDisabled(boolean disable)
Setter forredactionDisabled
field.- Specified by:
setRedactionDisabled
in interfaceReportingCommandsExecutor
- Parameters:
disable
- True to disable or False to enable.
-
getCurrentTest
public java.util.concurrent.atomic.AtomicReference<java.lang.String> getCurrentTest()
Getter for CURRENT_TEST field.- Specified by:
getCurrentTest
in interfaceReportingCommandsExecutor
- Returns:
- value of CURRENT_TEST field
-
-