-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Here is my code
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("app", "C:\Program Files (x86)\Notepad++\notepad++.exe");
capabilities.setCapability("platformName", "Windows");
capabilities.setCapability("deviceName", "WindowsPC");
notePadPlusSession = new WindowsDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
notePadPlusSession.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
String notePadTitle="new 0 - Notepad++";
String actualNotePadTitle = notePadPlusSession.getTitle();
System.out.println(actualNotePadTitle);
Assert.assertEquals(actualNotePadTitle, notePadTitle);
Thread.sleep(10000);
RemoteWebElement new_btn = notePadPlusSession.findElementByName("Find...");
new_btn.click();
Issue: Error shows
"An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)" even Name attribute is correct as inspect.exe tool
But it did work when using
- using findElementByXPath as below
RemoteWebElement new_btn = notePadPlusSession.findElementByXPath("//Button[13]");
=> it is not timeout problem as I thought - And findelementByName also worked fine when automating Calculator app
=> it is not a problem with findelementByName as well
My setup
Appium v1.14.0
WinAppDriver version 1.1
selenium-java-3.141.59
Attached appium log and image
Appium_log.txt
I am not sure what was wrong here so I am really appreciate if anybody can have a look on this.
Thanks,
Anh Pham