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(boolean disableReports, ReportType reportType)Initiates a new session with the Agent using default token and URL and reports commands.GenericDriver(ReportType reportType)Initiates a new session with the Agent using default token and URL.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, ReportType reportType)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 projectName, java.lang.String jobName, ReportType reportType)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.lang.String token, java.lang.String projectName, java.lang.String jobName, ReportType reportType)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, ReportType reportType)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 token, ReportType reportType)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 projectName, java.lang.String jobName, ReportType reportType)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, ReportType reportType)Initiates a new session with the Agent using provided Agent URL, token, Project and Job names.GenericDriver(java.net.URL remoteAddress, java.lang.String token, java.lang.String projectName, java.lang.String jobName, boolean disableReports, ReportType reportType, java.lang.String reportName, java.lang.String reportPath)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 ReportingCommandsExecutorgetReportingCommandExecutor()Returns a local command executor.voidquit()Quits the driver and reports test completion.Reporterreport()Provides access to the reporting functionality and settings.voidstop()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, ObsoleteVersionExceptionInitiates 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(ReportType reportType) 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
- Parameters:
reportType- A type of report to produce - cloud, local or both.- 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, ObsoleteVersionExceptionInitiates 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(boolean disableReports, ReportType reportType) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionExceptionInitiates 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.reportType- A type of report to produce - cloud, local or both.- 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, ObsoleteVersionExceptionInitiates 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, ReportType reportType) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionExceptionInitiates 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 reportreportType- A type of report to produce - cloud, local or both.- 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, ObsoleteVersionExceptionInitiates 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 projectName, java.lang.String jobName, ReportType reportType) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionExceptionInitiates 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 reportreportType- A type of report to produce - cloud, local or both.- 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, ObsoleteVersionExceptionInitiates 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.lang.String token, java.lang.String projectName, java.lang.String jobName, ReportType reportType) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionExceptionInitiates 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 reportreportType- A type of report to produce - cloud, local or both.- 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, ObsoleteVersionExceptionInitiates 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, ReportType reportType) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionExceptionInitiates 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/)reportType- A type of report to produce - cloud, local or both.- 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, ObsoleteVersionExceptionInitiates 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 projectName, java.lang.String jobName, ReportType reportType) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionExceptionInitiates 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 reportreportType- A type of report to produce - cloud, local or both.- 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, ObsoleteVersionExceptionInitiates 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, ReportType reportType) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionExceptionInitiates 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 pagereportType- A type of report to produce - cloud, local or both.- 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, ReportType reportType) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionExceptionInitiates 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.reportType- A type of report to produce - cloud, local or both.- 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, ReportType reportType, java.lang.String reportName, java.lang.String reportPath) throws InvalidTokenException, AgentConnectException, java.io.IOException, ObsoleteVersionExceptionInitiates 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.reportType- A type of report to produce - cloud, local or both.reportName- The name of the generated report.reportPath- The path to the generated 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
-
-
Method Detail
-
report
public Reporter report()
Provides access to the reporting functionality and settings.- Specified by:
reportin interfaceReportingDriver- Returns:
Reporterinstance.
-
stop
public void stop()
Description copied from interface:ReportingDriverStops the driver and perform necessary cleanup.- Specified by:
stopin interfaceReportingDriver
-
getReportingCommandExecutor
public ReportingCommandsExecutor getReportingCommandExecutor()
Returns a local command executor.- Specified by:
getReportingCommandExecutorin interfaceReportingDriver- Returns:
- An instance of
ReportingCommandsExecutorused by the driver.
-
quit
public void quit()
Quits the driver and reports test completion.
-
-