Home>
I'm considering whether Appium can automate the work, but it's not working well due to lack of knowledge.
I tried to create a simple program to open notepad, type letters, and save
FindElementByName ("File name:"). SendKeys ("test.txt") does not reflect test.txt"in the text box.
Can you tell me how to operate correctly?
using OpenQA.Selenium.Remote;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AppiumTest01
{
class Program public static void Main (string [] args)
{
var drivers = new Dictionary<string, RemoteWebDriver>();
// Execute Windows Application Driver
string serverPath = System.IO.Path.Combine (
"C: \\ work", @ "Windows Application Driver", "WinAppDriver.exe"
);
System.Diagnostics.Process.Start (serverPath);
DesiredCapabilities appCapabilities = new DesiredCapabilities ();
//Notepad
appCapabilities.SetCapability ("app", @ "C: \ Windows \ System32 \ notepad.exe");
drivers.Add ("notepad", new RemoteWebDriver (new Uri (@ "http://127.0.0.1:4723"), appCapabilities));
drivers ["notepad"]. Manage (). Timeouts (). ImplicitlyWait (TimeSpan.FromSeconds (2));
//drivers["notepad"].FindElementByClassName("Notepad").SendKeys("Hello Windows Application Driver World! ");
drivers ["notepad"]. FindElementByName ("Text Editor"). SendKeys ("Hello Windows Application Driver World!");
drivers ["notepad"]. FindElementByName ("File (F)"). Click ();
drivers ["notepad"]. FindElementByName ("Save As ..."). Click ();// So far it works
drivers ["notepad"]. FindElementByName ("File name:"). SendKeys ("test.txt");// Here
drivers ["notepad"]. Dispose ();
drivers ["notepad"] = null;
}
-
Answer # 1
Related articles
- javascript - i want to use bxslider with ruby on rails!
- c # - i want to get a datatable with linq and then outer join
- python - i want to use spinbox with kivy
- unity - i want to use virtualbutton with vuforia
- i want to use java with vscode
- jquery - i want to use sortable with tuslaravel
- vuejs - i want to use firebase with vs code
- unity - i want to use addresable with webgl
- typescript - i want to use axios with nuxtjs to get data from an api
- c # - i want to use addvectorobs ()
- routing - i want to use react-router with firebase
- c # - i want to replace a file with the same name in asset
- i want to use opengl with gcc
- vuejs - i want to use iframe with vue
- i want to use pointers in c # as in c ++
- python - i want to use pandas with vs code
- python - i want to use oauth2client with heroku
- c # - condition each variable with linq
- c # - i want to do something like log output in wpf
- i want to use google map on ios app with expo
Trends
- python - you may need to restart the kernel to use updated packages error
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- javascript - how to check if an element exists in puppeteer
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to check the type of a shell script variable
- i want to call a child component method from a parent in vuejs
I decided to use around Winium