Class GenericDriver
- java.lang.Object
-
- io.testproject.sdk.drivers.GenericDriver
-
- All Implemented Interfaces:
ReportingDriver
public final class GenericDriver extends java.lang.Object implements ReportingDriver
Generic Driver that can be used to perform a non-UI automation.
-
-
Field Summary
-
Fields inherited from interface io.testproject.sdk.drivers.ReportingDriver
LOG
-
-
Constructor Summary
Constructors Constructor Description GenericDriver()
Initiates a new session with the Agent using default token and URL.GenericDriver(boolean disableReports)
Initiates a new session with the Agent using default token and URL and reports commands.GenericDriver(java.lang.String projectName)
Initiates a new session with the Agent using default token and URL with Project name.GenericDriver(java.lang.String projectName, java.lang.String jobName)
Initiates a new session with the Agent using default token and URL.GenericDriver(java.lang.String token, java.lang.String projectName, java.lang.String jobName)
Initiates a new session with the Agent using provided token and default URL and Project name.GenericDriver(java.net.URL remoteAddress)
Initiates a new session with the Agent using provided Agent URL and default token.GenericDriver(java.net.URL remoteAddress, java.lang.String token)
Initiates a new session with the Agent using provided Agent URL and token.GenericDriver(java.net.URL remoteAddress, java.lang.String projectName, java.lang.String jobName)
Initiates a new session with the Agent using provided Agent URL, default token, Project and Job names.GenericDriver(java.net.URL remoteAddress, java.lang.String token, java.lang.String projectName, java.lang.String jobName, boolean disableReports)
Initiates a new session with the Agent using provided Agent URL, token, Project and Job names.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReportingCommandsExecutor
getReportingCommandExecutor()
Returns a local command executor.void
quit()
Quits the driver and reports test completion.Reporter
report()
Provides access to the reporting functionality and settings.void
stop()
Stops the driver and perform necessary cleanup.-
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.drivers.ReportingDriver
addons, getScreenshot
-
-
-
-
Constructor Detail
-
GenericDriver
public GenericDriver() throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionException
Initiates a new session with the Agent using default token and URL.Default Agent URL can be set using TP_AGENT_URL environment variable. If the environment variable is not set, default URL http://localhost:8585 is used.
Default token can be set using TP_DEV_TOKEN environment variable. You can get a token from SDK page
- Throws:
AgentConnectException
- if Agent is not responding or responds with an errorInvalidTokenException
- if the token provided is invalidjava.io.IOException
- if the Agent API base URL provided is malformedObsoleteVersionException
- if the SDK version is incompatible with the Agent
-
GenericDriver
public GenericDriver(boolean disableReports) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionException
Initiates a new session with the Agent using default token and URL and reports commands.Default Agent URL can be set using TP_AGENT_URL environment variable. If the environment variable is not set, default URL http://localhost:8585 is used.
Default token can be set using TP_DEV_TOKEN environment variable. You can get a token from SDK page
Creates a new instance based on
capabilities
.- Parameters:
disableReports
- True to disable automatic reporting of driver commands and tests, otherwise False.- Throws:
AgentConnectException
- if Agent is not responding or responds with an errorInvalidTokenException
- if the token provided is invalidjava.io.IOException
- if the Agent API base URL provided is malformedObsoleteVersionException
- if the SDK version is incompatible with the Agent
-
GenericDriver
public GenericDriver(java.lang.String projectName) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionException
Initiates a new session with the Agent using default token and URL with Project name.Default Agent URL can be set using TP_AGENT_URL environment variable. If the environment variable is not set, default URL http://localhost:8585 is used.
Default token can be set using TP_DEV_TOKEN environment variable. You can get a token from SDK page
Creates a new instance based on
capabilities
.- Parameters:
projectName
- Project name to report- Throws:
AgentConnectException
- if Agent is not responding or responds with an errorInvalidTokenException
- if the token provided is invalidjava.io.IOException
- if the Agent API base URL provided is malformedObsoleteVersionException
- if the SDK version is incompatible with the Agent
-
GenericDriver
public GenericDriver(java.lang.String projectName, java.lang.String jobName) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionException
Initiates a new session with the Agent using default token and URL.Default Agent URL can be set using TP_AGENT_URL environment variable. If the environment variable is not set, default URL http://localhost:8585 is used.
Default token can be set using TP_DEV_TOKEN environment variable. You can get a token from SDK page
Creates a new instance based on
capabilities
.- Parameters:
projectName
- Project name to reportjobName
- Job name to report- Throws:
AgentConnectException
- if Agent is not responding or responds with an errorInvalidTokenException
- if the token provided is invalidjava.io.IOException
- if the Agent API base URL provided is malformedObsoleteVersionException
- if the SDK version is incompatible with the Agent
-
GenericDriver
public GenericDriver(java.lang.String token, java.lang.String projectName, java.lang.String jobName) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionException
Initiates a new session with the Agent using provided token and default URL and Project name.Default Agent URL can be set using TP_AGENT_URL environment variable. If the environment variable is not set, default URL http://localhost:8585 is used.
Creates a new instance based on
capabilities
.- Parameters:
token
- Development token that should be obtained from SDK pageprojectName
- Project name to reportjobName
- Job name to report- Throws:
AgentConnectException
- if Agent is not responding or responds with an errorInvalidTokenException
- if the token provided is invalidjava.io.IOException
- if the Agent API base URL provided is malformedObsoleteVersionException
- if the SDK version is incompatible with the Agent
-
GenericDriver
public GenericDriver(java.net.URL remoteAddress) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionException
Initiates a new session with the Agent using provided Agent URL and default token.Default token can be set using TP_DEV_TOKEN environment variable. You can get a token from SDK page
Creates a new instance based on
capabilities
.- Parameters:
remoteAddress
- Agent API base URL (e.g. http://localhost:8585/)- Throws:
AgentConnectException
- if Agent is not responding or responds with an errorInvalidTokenException
- if the token provided is invalidjava.io.IOException
- if the Agent API base URL provided is malformedObsoleteVersionException
- if the SDK version is incompatible with the Agent
-
GenericDriver
public GenericDriver(java.net.URL remoteAddress, java.lang.String projectName, java.lang.String jobName) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionException
Initiates a new session with the Agent using provided Agent URL, default token, Project and Job names.Default token can be set using TP_DEV_TOKEN environment variable. You can get a token from SDK page
Creates a new instance based on
capabilities
.- Parameters:
remoteAddress
- Agent API base URL (e.g. http://localhost:8585/)projectName
- Project name to reportjobName
- Job name to report- Throws:
AgentConnectException
- if Agent is not responding or responds with an errorInvalidTokenException
- if the token provided is invalidjava.io.IOException
- if the Agent API base URL provided is malformedObsoleteVersionException
- if the SDK version is incompatible with the Agent
-
GenericDriver
public GenericDriver(java.net.URL remoteAddress, java.lang.String token) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionException
Initiates a new session with the Agent using provided Agent URL and token.- Parameters:
remoteAddress
- Agent API base URL (e.g. http://localhost:8585/)token
- Development token that should be obtained from SDK page- Throws:
AgentConnectException
- if Agent is not responding or responds with an errorInvalidTokenException
- if the token provided is invalidjava.io.IOException
- if the Agent API base URL provided is malformedObsoleteVersionException
- if the SDK version is incompatible with the Agent
-
GenericDriver
public GenericDriver(java.net.URL remoteAddress, java.lang.String token, java.lang.String projectName, java.lang.String jobName, boolean disableReports) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionException
Initiates a new session with the Agent using provided Agent URL, token, Project and Job names.- Parameters:
remoteAddress
- Agent API base URL (e.g. http://localhost:8585/)token
- Development token that should be obtained from SDK pageprojectName
- Project name to reportjobName
- Job name to reportdisableReports
- True to disable automatic reporting of driver commands and tests, otherwise False.- Throws:
AgentConnectException
- if Agent is not responding or responds with an errorInvalidTokenException
- if the token provided is invalidjava.io.IOException
- if the Agent API base URL provided is malformedObsoleteVersionException
- if the SDK version is incompatible with the Agent
-
-
Method Detail
-
report
public Reporter report()
Provides access to the reporting functionality and settings.- Specified by:
report
in interfaceReportingDriver
- Returns:
Reporter
instance.
-
stop
public void stop()
Description copied from interface:ReportingDriver
Stops the driver and perform necessary cleanup.- Specified by:
stop
in interfaceReportingDriver
-
getReportingCommandExecutor
public ReportingCommandsExecutor getReportingCommandExecutor()
Returns a local command executor.- Specified by:
getReportingCommandExecutor
in interfaceReportingDriver
- Returns:
- An instance of
ReportingCommandsExecutor
used by the driver.
-
quit
public void quit()
Quits the driver and reports test completion.
-
-