Skip to content

Selenium with Java :: Application never starting  #25

@sampadrout

Description

@sampadrout

Here is the java code:
package com.tratest.org;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;

public class tratest {
public static void main(String[] args) throws MalformedURLException,InterruptedException {
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("platformName", "Windows");
caps.setCapability("app","C:\Program Files (x86)\JAM Software\TreeSize Free\TreeSizeFree.exe");
WebDriver driver = new RemoteWebDriver(new URL("http://127.0.0.1:4444/wd/hub"), caps);

    driver.quit();
}

}
When i am running it, the application is never opening up. Here is the server log:
2015-10-22 23.46.19.916 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/active => ^/wd/hub/session/(?[^/]+)/element/active$
2015-10-22 23.46.19.936 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/buttonup => ^/wd/hub/session/(?[^/]+)/buttonup$
2015-10-22 23.46.19.936 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/buttondown => ^/wd/hub/session/(?[^/]+)/buttondown$
2015-10-22 23.46.19.937 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/clear => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/clear$
2015-10-22 23.46.19.938 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/click => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/click$
2015-10-22 23.46.19.940 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/click => ^/wd/hub/session/(?[^/]+)/click$
2015-10-22 23.46.19.940 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/window => ^/wd/hub/session/(?[^/]+)/window$
2015-10-22 23.46.19.941 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId => ^/wd/hub/session/(?[^/]+)$
2015-10-22 23.46.19.941 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/doubleclick => ^/wd/hub/session/(?[^/]+)/doubleclick$
2015-10-22 23.46.19.942 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/element => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/element$
2015-10-22 23.46.19.942 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element => ^/wd/hub/session/(?[^/]+)/element$
2015-10-22 23.46.19.943 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/elements => ^/wd/hub/session/(?[^/]+)/elements$
2015-10-22 23.46.19.943 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/elements => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/elements$
2015-10-22 23.46.19.944 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/attribute/:name => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/attribute/(?[^/]+)$
2015-10-22 23.46.19.944 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/location => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/location$
2015-10-22 23.46.19.945 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/location_in_view => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/location_in_view$
2015-10-22 23.46.19.946 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/size => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/size$
2015-10-22 23.46.19.946 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/name => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/name$
2015-10-22 23.46.19.947 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/text => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/text$
2015-10-22 23.46.19.947 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/window_handle => ^/wd/hub/session/(?[^/]+)/window_handle$
2015-10-22 23.46.19.948 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/source => ^/wd/hub/session/(?[^/]+)/source$
2015-10-22 23.46.19.948 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/title => ^/wd/hub/session/(?[^/]+)/title$
2015-10-22 23.46.19.949 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/window/:windowHandle/position => ^/wd/hub/session/(?[^/]+)/window/(?[^/]+)/position$
2015-10-22 23.46.19.949 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/window_handles => ^/wd/hub/session/(?[^/]+)/window_handles$
2015-10-22 23.46.19.950 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/window/:windowHandle/size => ^/wd/hub/session/(?[^/]+)/window/(?[^/]+)/size$
2015-10-22 23.46.19.951 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/timeouts/implicit_wait => ^/wd/hub/session/(?[^/]+)/timeouts/implicit_wait$
2015-10-22 23.46.19.954 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/displayed => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/displayed$
2015-10-22 23.46.19.958 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/enabled => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/enabled$
2015-10-22 23.46.19.961 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/selected => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/selected$
2015-10-22 23.46.19.964 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/moveto => ^/wd/hub/session/(?[^/]+)/moveto$
2015-10-22 23.46.19.967 [Verbose] WinAppDriver: Pattern conversion; /session => ^/wd/hub/session$
2015-10-22 23.46.19.970 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/equals/:other => ^/wd/hub /session/(?[^/]+)/element/(?[^/]+)/equals/(?[^/]+)$
2015-10-22 23.46.19.974 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/screenshot => ^/wd/hub/session/(?[^/]+)/screenshot$
2015-10-22 23.46.19.977 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/keys => ^/wd/hub/session/(?[^/]+)/keys$
2015-10-22 23.46.19.988 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/element/:id/value => ^/wd/hub/session/(?[^/]+)/element/(?[^/]+)/value$
2015-10-22 23.46.19.991 [Verbose] WinAppDriver: Pattern conversion; /session/:sessionId/window => ^/wd/hub/session/(?[^/]+)/window$
2015-10-22 23.46.20.039 [Information] WinAppDriver: WinAppDriver started on 0.0.0.0:4444
2015-10-22 23.46.26.108 [Verbose] WinAppDriver: Request: POST /wd/hub/session
{"desiredCapabilities":{"app":"C:\Program Files (x86)\JAM Software\TreeSize Free\TreeSizeFree.exe","platformName":"Windows"}}
2015-10-22 23.46.26.113 [Verbose] WinAppDriver: A corresponding endpoint found: WinAppDriver.Handlers.NewSessionHandler
2015-10-22 23.46.27.205 [Information] WinAppDriver: app = C:\Program Files (x86)\JAM Software\TreeSize Free\TreeSizeFree.exe (System.String)
2015-10-22 23.46.27.207 [Information] WinAppDriver: platformName = Windows (System.String)
2015-10-22 23.46.27.272 [Information] WinAppDriver: App 'Windows (Desktop)' is already installed, and the installation package is also provided.
2015-10-22 23.46.27.280 [Verbose] WinAppDriver: Current file: [C:\Users\anindita\AppData\Local\WinAppDriver\Windows (Desktop)\Current.txt]; app = [Windows (Desktop)]
2015-10-22 23.46.27.282 [Verbose] WinAppDriver: Current file does not exist.
2015-10-22 23.46.27.290 [Information] WinAppDriver: Build changed, because current build (checksum) is unknown; app = [Windows (Desktop)]
2015-10-22 23.46.27.293 [Information] WinAppDriver: Build changed. Strategy: Reinstall, Reset: Fast
2015-10-22 23.46.27.303 [Verbose] WinAppDriver: Prepare installation package; app = [Windows (Desktop)], base dir = [C:\Users\anindita\AppData\Local\WinAppDriver\Windows (Desktop)\InstallationPackage], caps.App = [C:\Program Files (x86)\JAM Software\TreeSize Free\TreeSizeFree.exe], caps.AppChecksum = []
2015-10-22 23.46.27.311 [Verbose] WinAppDriver: Cached package info file: [C:\Users\anindita\AppData\Local\WinAppDriver\Windows (Desktop)\InstallationPackage\Info.txt]; app = [Windows (Desktop)]
2015-10-22 23.46.27.343 [Verbose] WinAppDriver: Cached package info: filename = [StoreApp_20151022234122.exe], checksum = [83609976d37a0dd6e8e0e5e55a3a290d]
2015-10-22 23.46.27.344 [Information] WinAppDriver: Start downloading installation pacakge of app 'Windows (Desktop)' from C:\Program Files (x86)\JAM Software\TreeSize Free\TreeSizeFree.exe.
2015-10-22 23.46.27.351 [Information] WinAppDriver: Downloading file "C:\Program Files (x86)\JAM Software\TreeSize Free\TreeSizeFree.exe" .......
2015-10-22 23.46.27.857 [Verbose] WinAppDriver: Successfully downloaded file from "C:\Program Files (x86)\JAM Software\TreeSize Free\TreeSizeFree.exe"
2015-10-22 23.46.27.859 [Verbose] WinAppDriver: Downloaded file saved in the following file system folder: "C:\Users\anindita\AppData\Local\Temp\StoreApp_20151022234627.exe"
2015-10-22 23.46.27.910 [Information] WinAppDriver: Installation package downloaded: C:\Users\anindita\AppData\Local\Temp\StoreApp_20151022234627.exe (83609976d37a0dd6e8e0e5e55a3a290d).
2015-10-22 23.46.27.924 [Information] WinAppDriver: Cache the installation package: C:\Users\anindita\AppData\Local\WinAppDriver\Windows (Desktop)\InstallationPackage\StoreApp_20151022234627.exe.
2015-10-22 23.46.27.948 [Verbose] WinAppDriver: Write cached package info; app = [Windows (Desktop)], path = [C:\Users\anindita\AppData\Local\WinAppDriver\Windows (Desktop)\InstallationPackage\Info.txt], filename = [StoreApp_20151022234627.exe], checksum = [83609976d37a0dd6e8e0e5e55a3a290d]
2015-10-22 23.46.27.960 [Information] WinAppDriver: Install command is not provided, so directly invoke the (executable?) installation package 'C:\Users\anindita\AppData\Local\WinAppDriver\Windows (Desktop)\InstallationPackage\StoreApp_20151022234627.exe'.
2015-10-22 23.46.27.969 [Information] WinAppDriver: Requested to activate the UAC prompt handler; allowed = True
2015-10-22 23.46.27.973 [Information] WinAppDriver: The thread for handling UAC prompts created.
2015-10-22 23.46.27.979 [Verbose] WinAppDriver: Parse command; [C:\Users\anindita\AppData\Local\WinAppDriver\Windows (Desktop)\InstallationPackage\StoreApp_20151022234627.exe] ==> executable = [C:\Users\anindita\AppData\Local\WinAppDriver\Windows], arguments = [ (Desktop)\InstallationPackage\StoreApp_20151022234627.exe]
2015-10-22 23.46.28.011 [Information] WinAppDriver: Requested to deactivate the UAC prompt handler.
2015-10-22 23.46.28.015 [Information] WinAppDriver: Trying to find the (focused) UAC elevation prompt.
2015-10-22 23.46.28.050 [Error] WinAppDriver: Error occurred.
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at WinAppDriver.Utils.Execute(String command, IDictionary2 variables) in z:\work\winappdriver\src\WinAppDriver\IUtils.cs:line 201 at WinAppDriver.Desktop.DesktopApp.TriggerCustomAction(String command, IDictionary2 envs) in z:\work\winappdriver\src\WinAppDriver\Desktop\DesktopApp.cs:line 144
at WinAppDriver.Desktop.DesktopApp.TriggerCustomAction(String command, IDictionary2 envs, Int32& waitExitCode) in z:\work\winappdriver\src\WinAppDriver\Desktop\DesktopApp.cs:line 149 at WinAppDriver.Desktop.DesktopAppInstaller.InstallImpl(String package, String checksum) in z:\work\winappdriver\src\WinAppDriver\Desktop\DesktopAppInstaller.cs:line 51 at WinAppDriver.AppInstaller1.Install() in z:\work\winappdriver\src\WinAppDriver\AppInstaller.cs:line 77
at WinAppDriver.Handlers.NewSessionHandler.Handle(Dictionary`2 urlParams, String body, ISession& session) in z:\work\winappdriver\src\WinAppDriver\Handlers\NewSessionHandler.cs:line 75
at WinAppDriver.RequestManager.Handle(String method, String path, String body, ISession& session) in z:\work\winappdriver\src\WinAppDriver\RequestManager.cs:line 48
at WinAppDriver.Server.HandleRequest(HttpListenerRequest request, HttpListenerResponse response) in z:\work\winappdriver\src\WinAppDriver\Server.cs:line 47
2015-10-22 23.46.28.080 [Verbose] WinAppDriver: Response (Status: BadRequest, ContentType: text/plain):
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnost

Need your help on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions