I try to run an automation on notepad file on windows via winnap driver. and I get : "FAILED CONFIGURATION: @BeforeMethod setUp org.openqa.selenium.WebDriverException: Connection refused: no further information"
What is can be ?
JAVA :
package com.mytest;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import io.appium.java_client.windows.WindowsDriver;
public class NotePadTest {
public static WindowsDriver driver = null ;
@BeforeMethod
public void setUp() {
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("app","C:\\Windows\\System32\\notepad.exe");
cap.setCapability( "platform", "Windows");
cap.setCapability( "deviceName", "WindowsPC");
try {
driver = new WindowsDriver(new URL("http://127.0.0.1:4723"), cap);
} catch (MalformedURLException e) {
// TODO: handle exception
e.printStackTrace();
}
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
}
@AfterMethod
public void clenUp() {
driver.quit();
setUp();
}
@AfterSuite
public void tearDown() {
driver.quit();
}
@Test
public void checkHelpAboutNowTest() {
driver.findElementByName("App theme").click();
}
}