I am trying to automate .jnlp applications located on remote machine. Developers have built .bat files to launch .jnlp Apps. JNLP apps uses Java to launch/open.
I am using Appium.Webdriver to launch/ Automate these apps. Below is my code
Tools: C#, Visual Studio, Appium.Webdriver, WinAppDriver, .Net 5.0, Selenium
public const string DriverUrl = "http://127.0.0.1:4723/";
public WindowsDriver<WindowsElement> DesktopSession;
[TestMethod]
public void TestMethod1()
{
//Start WinappDriver
Process.Start(@"C:\Program Files (x86)\Windows Application Driver\WinappDriver.exe");
Thread.Sleep(3000);
// Start jnlp application
Process.Start(@"\\<folderPath>\launch-App.bat");
Thread.Sleep(20000);
AppiumOptions Options = new AppiumOptions();
Options.AddAdditionalCapability("app", @"\\<RemoteFolderPath>\JnlpApp.jnlp");
Options.AddAdditionalCapability("deviceName", "WindowsPC");
Options.AddAdditionalCapability("ms:waitForAppLaunch", "20");
Options.AddAdditionalCapability("appWorkingDir", @"\\<AppFolderPath>");
try
{
DesktopSession = new WindowsDriver<WindowsElement>(new Uri(DriverUrl), Options);
Assert.IsNotNull(DesktopSession);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
Exception: The specified Executable is not a valid application for this OS Platform
Note: Application is launched successfully. But DesktopSession is set null.