In order to test an electron application. How does one use selenium to identify its elements or using F12 dev tools? As in order to write a selenium script one would have to identify the elements initially. How do I decompose an electron application to view its elements? Suggestions?
For this question it depends on which webdriver Selenium is using. I am testing with Spectron based on Electron, but my elements are identified by
To reach a element you can use the id, class, css or xPath
Next up I can get an element and do whatever I want with it
browser.element(selector); // Default browser.element('#id'); browser.element('.class'); browser.element('.multiple.classes.to.find.element'); browser.element('//xpath');
If that doesnt work read, "How to make developer tools appear".
If you are using WebdriverJS, then you need to run ./node_modules/.bin/chromedriver in this step.
I have followed the documentation at https://electronjs.org/docs/tutorial/using-selenium-and-webdriver and I was able to capture the elements.