# Start appium(V1.3.2 Appium desktop) server through code on windows

**URL:** <https://discuss.appium.io/t/start-appium-v1-3-2-appium-desktop-server-through-code-on-windows/21090>\
**Category:** Issues/Bugs\
**Created:** [February 26, 2018, 8:41am UTC](https://discuss.appium.io/t/start-appium-v1-3-2-appium-desktop-server-through-code-on-windows/21090 "2018-02-26T08:41:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nv\_sateesh](https://discuss.appium.io/letter_avatar_proxy/v4/letter/n/6bbea6/32.png) [@nv\_sateesh](https://discuss.appium.io/u/nv_sateesh)\
**Post date:** [February 26, 2018, 8:41am UTC](https://discuss.appium.io/t/start-appium-v1-3-2-appium-desktop-server-through-code-on-windows/21090/1 "2018-02-26T08:41:38Z")

</div>

Hi All,  
I’m facing the below exception with Appium-Desktop v1.3.2 (downloaded from [appium.io](http://appium.io)), and trying to connect to appium server but not connecting to server. pls let me know the issue

in the latest version of Appium-Desktop do we need to provide main.js or appium.js file in the commandLineArgument. i tried both but still giving the error.

```
Starting appium server

```

Started appium server  
Step-1  
Step-2  
Error: Cannot find module ‘electron’  
at Function.Module.\_resolveFilename (module.js:538:15)  
at Function.Module.\_load (module.js:468:25)  
at Module.require (module.js:587:17)  
at require (internal/module.js:11:18)  
at Object.module.exports.Object.defineProperty.value (C:\Users\satheeshnukala\AppData\Local\Programs\appium-desktop\resources\app\webpack:\external “electron”:1:1)  
at **webpack\_require** (C:\Users\satheeshnukala\AppData\Local\Programs\appium-desktop\resources\app\webpack:\webpack\bootstrap dfa496e38cddd9338602:19:1)  
at Object. (C:\Users\satheeshnukala\AppData\Local\Programs\appium-desktop\resources\app\webpack:\app\main\main.development.js:1:1)  
at **webpack\_require** (C:\Users\satheeshnukala\AppData\Local\Programs\appium-desktop\resources\app\webpack:\webpack\bootstrap dfa496e38cddd9338602:19:1)  
at Object. (C:\Users\satheeshnukala\AppData\Local\Programs\appium-desktop\resources\app\main.js:50:19)  
at **webpack\_require** (C:\Users\satheeshnukala\AppData\Local\Programs\appium-desktop\resources\app\webpack:\webpack\bootstrap dfa496e38cddd9338602:19:1)  
Exception in thread “main” org.openqa.selenium.WebDriverException: Connection refused: connect  
Build info: version: ‘3.9.1’, revision: ‘63f7b50’, time: ‘2018-02-07T22:42:28.403Z’  
System info: host: ‘10INLPC0BS59M’, ip: ‘10.216.42.151’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0\_144’  
Driver info: driver.version: AndroidDriver  
at io.appium.java\_client.remote.AppiumCommandExecutor.lambda$2(AppiumCommandExecutor.java:141)  
at java.util.Optional.orElseGet(Optional.java:267)  
at io.appium.java\_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:140)  
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)  
at io.appium.java\_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)  
at io.appium.java\_client.AppiumDriver.execute(AppiumDriver.java:1)  
at io.appium.java\_client.android.AndroidDriver.execute(AndroidDriver.java:1)  
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)  
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)  
at io.appium.java\_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)  
at io.appium.java\_client.AppiumDriver.(AppiumDriver.java:84)  
at io.appium.java\_client.AppiumDriver.(AppiumDriver.java:94)  
at io.appium.java\_client.android.AndroidDriver.(AndroidDriver.java:77)  
at AppiumPackage.AppiumServerJava.startServer(AppiumServerJava.java:62)  
at AppiumPackage.AppiumServerJava.main(AppiumServerJava.java:110)  
Caused by: java.net.ConnectException: Connection refused: connect  
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)  
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)  
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)  
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)  
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)  
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)  
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)  
at java.net.Socket.connect(Socket.java:589)  
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)  
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)  
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)  
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)  
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)  
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)  
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)  
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)  
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)  
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)  
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)  
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:151)  
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:91)  
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:69)  
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:101)  
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)  
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:138)  
at io.appium.java\_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:129)  
… 12 more

---

<div class="post-metadata">

**Author:** ![Jeeva](https://discuss.appium.io/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@Jeeva](https://discuss.appium.io/u/Jeeva)\
**Post date:** [February 26, 2018, 9:52am UTC](https://discuss.appium.io/t/start-appium-v1-3-2-appium-desktop-server-through-code-on-windows/21090/2 "2018-02-26T09:52:57Z")

</div>

Try this —\> [http://aksahu.blogspot.in/2015/10/start-and-stop-appium-server.html](http://aksahu.blogspot.in/2015/10/start-and-stop-appium-server.html)

---

<div class="post-metadata">

**Author:** ![nv\_sateesh](https://discuss.appium.io/letter_avatar_proxy/v4/letter/n/6bbea6/32.png) [@nv\_sateesh](https://discuss.appium.io/u/nv_sateesh)\
**Post date:** [February 27, 2018, 10:29am UTC](https://discuss.appium.io/t/start-appium-v1-3-2-appium-desktop-server-through-code-on-windows/21090/3 "2018-02-27T10:29:34Z")

</div>

Thanks @Jeeva i’ve tried that way too earlier, but could not able to access the appium server.

This Appim code in the blog will work when I installed the appium through node or npm commands right? correct me if i’m wrong.

is there any way to make it work, pls let me know?

---

<div class="post-metadata">

**Author:** ![leenotes](https://discuss.appium.io/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@leenotes](https://discuss.appium.io/u/leenotes)\
**Post date:** [March 20, 2019, 8:56am UTC](https://discuss.appium.io/t/start-appium-v1-3-2-appium-desktop-server-through-code-on-windows/21090/4 "2019-03-20T08:56:42Z")

</div>

A great open source appium script recording tool, more than that, appium gives a lot of tools possible

> [@A great open source appium script recording tool, more than record](https://discuss.appium.io/t/a-great-open-source-appium-script-recording-tool-more-than-record/25596):
>
> Testwa supports an open source tool for appium script recording, contributed by the Chinese technical team，Welcome everyone to use
