electron-userland / spectron

DEPRECATED: 🔎 Test Electron apps using ChromeDriver
http://electronjs.org/spectron
MIT License
1.68k stars 229 forks source link

Element Wasn't Found After Upgrading my Spectron Version to 15 & Electron to 13 #1025

Closed filbertwjy closed 2 years ago

filbertwjy commented 2 years ago

hi, im currently working on testing an electron application with spectron. I upgraded my electron app to 13.1.7 and my spectron to 15.0.0 something went wrong. the spectron cant locate the element , whereas I've already locate the element properly and matched with the id of the button of submit.

here is the further info: "author": "Filbert Wijaya", "license": "MIT", "devDependencies": { "@testing-library/webdriverio": "^3.0.2", "@wdio/cli": "^7.9.1", "chai": "^4.3.4", "electron": "^13.1.7", "eslint": "^7.30.0", "esm": "^3.2.25", "mocha": "^8.4.0", "spectron": "^15.0.0" }, "engines": { "node": "^13.12.0" }, "dependencies": { "@types/webdriverio": "^5.0.0", "webdriverio": "^7.9.1" } }

filbertwjy commented 2 years ago

---here is the code---

import { startApp, stopApp } from "./hooks"; import { homePage, serverPage } from "./page-objects/General_Id"; describe("Server Access & Login Test ", () => { let app;

it("Open App", async () => { app = await startApp(); }); const accessButton = await app.client.$(serverPage.button); await accessButton.click();

---and here is the code to locate element id from General_Id files--- export const serverPage = { formId: "#serverId", button: "#submitButton", };