0

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();
    }

}

enter image description here

yakov sachuk
  • 145
  • 1
  • 11
  • how do you run appium? from command line? have you started cmd with admin permissions? – Andrey Kotov Jul 03 '22 at 12:44
  • 1
    seems your appium server is unavailable. Also make sure you enabled [developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development) – Andrey Kotov Jul 03 '22 at 12:55

0 Answers0