Our application is developed using electron framework. it is a standalone application. I have seen that spectron is the framework which is used to automate electron application. but i am not sure whether it is applicable for desktop application. Please confirm the same.
I have installed nodejs and spectron. I have written a code launch application as mention in the following site https://electron.atom.io/spectron/
File Name : First.js
var Application = require('spectron').Application
var assert = require('assert')
var app = new Application({
path: 'C:\Users\ramass\AppData\Local\Programs\ngsolutions\ngsolutions.exe'
})
app.start().then(function () {
// Check if the window is visible
return app.browserWindow.isVisible()
}).then(function (isVisible) {
// Verify the window is visible
assert.equal(isVisible, true)
}).then(function () {
// Get the window's title
return app.client.getTitle()
}).then(function (title) {
// Verify the window's title
assert.equal(title, 'My App')
}).then(function () {
// Stop the application
return app.stop()
}).catch(function (error) {
// Log any failures
console.error('Test failed', error.message)
})
i have tried to run the script using command
node First.js
But i am getting error saying that
C:\spectronprgs>node First.js
Error: Cannot find module 'spectron'
Please let me know whether I am going towards right path how to launch .exe file using spectron framework how to run the script