Search in sources :

Example 1 with RemoteFileSystemOperations

use of com.axway.ats.action.filesystem.RemoteFileSystemOperations in project ats-framework by Axway.

the class RemoteSystemOperations method createScreenshot.

@Override
public String createScreenshot(String filePath) {
    try {
        String remoteFilePath = null;
        int extIndex = filePath.lastIndexOf('.');
        if (extIndex > 0) {
            remoteFilePath = filePath.substring(extIndex);
        }
        remoteFilePath = this.remoteSystemOperations.createScreenshot(remoteFilePath);
        new RemoteFileSystemOperations(atsAgent).copyFileFrom(remoteFilePath, filePath, true);
    } catch (AgentException e) {
        throw new SystemOperationException("Could not create screenshot on agent: " + atsAgent, e);
    }
    return filePath;
}
Also used : AgentException(com.axway.ats.agent.core.exceptions.AgentException) SystemOperationException(com.axway.ats.common.system.SystemOperationException) RemoteFileSystemOperations(com.axway.ats.action.filesystem.RemoteFileSystemOperations)

Aggregations

RemoteFileSystemOperations (com.axway.ats.action.filesystem.RemoteFileSystemOperations)1 AgentException (com.axway.ats.agent.core.exceptions.AgentException)1 SystemOperationException (com.axway.ats.common.system.SystemOperationException)1