-2

I want to write an automation desktop app
I used three frameworks by using C# language

  1. Appium
  2. FlaUI
  3. Winium

My windows application start with auto updating when to start.

First using Appium it throw message is

The system cannot find the file specifiled

Code

        var appiumOptions = new AppiumOptions();

        appiumOptions.AddAdditionalCapability("app", @"C:\\Testapp\TestAutoUpdateAppWinform.exe");
        appiumOptions.AddAdditionalCapability("deviceName", "WindowsPC");
        appiumOptions.AddAdditionalCapability("platformName", "Windows");

        var _driver = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appiumOptions);

        _driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);

Second using FlaUI it throw message is

The system cannot find the file specifiled

Code

        var app = FlaUI.Core.Application.Launch(@"C:\\Testapp\TestAutoUpdateAppWinform.exe");
        using (var automation = new UIA2Automation())
        {
            Thread.Sleep(TimeSpan.FromSeconds(10));
            //await Task.Delay(TimeSpan.FromSeconds(10));
            //Task.Delay(TimeSpan.FromSeconds(2));
            var window = app.GetMainWindow(automation);

            string title = window.Title;

            var usernameTxt = window.FindFirstDescendant(cf => cf.ByAutomationId("330584")).AsTextBox();
            usernameTxt.Text = "sometext";



            window.Close();

        }

Third using Winium does work

Code

        var dc = new DesiredCapabilities();
        dc.SetCapability("app", @"C:\\Testapp\TestAutoUpdateAppWinform.exe");
        var driver = new RemoteWebDriver(new Uri("http://localhost:9999"), dc);

        //string title = driver.Title;
        //Console.WriteLine(title);

        var _ = driver.FindElementById("132516");

and I do not want to use Winium because it has less example.
I want to use FlaUI and Appium because it has more example and easy to use.

Felix
  • 7,790
  • 10
  • 53
  • 82
  • SUGGESTION: Consider modifying your code and explicitly give the *FULL PATH* for "file.exe". – paulsm4 May 08 '22 at 04:19
  • Yep, Path\File.exe is a example instead of Full Path in this case. – Peter Hanwa May 08 '22 at 04:23
  • "File not found" is pretty clear. Q: Are you specifying a complete path name? Have you confirmed that the path is correct, and the file exists? ALSO: if you want to use a relative path, consider building the pathname dynamically: https://stackoverflow.com/a/1222206/421195 – paulsm4 May 08 '22 at 04:27
  • Path\File.exe is a example instead of Full Path in this case. – Peter Hanwa May 08 '22 at 04:34
  • I understood that "Path\File.exe" (from your original post, before your "Edit") was an example. The point is that the error message is very clear: Either 1) you specified the path incorrectly, 2) you've given an incorrect relative path, and/or 3) file file doesn't actually exist in the path. ALSO: prefixing a string literal with `@ `means that you DON'T have to "escape" your back-slashes: https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-in-c. Who knows: incorrect "\" syntax might be the whole problem! – paulsm4 May 08 '22 at 20:27

0 Answers0