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?

4 Answers 4


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 webdriver IO.

To reach an 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


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 already know this. In order to know what elements for automated testing when writing the script in either webdriver or selenium is what I am looking to find out.
    – sNewbie
    Commented Jan 8, 2017 at 0:31

I have followed the documentation at https://electronjs.org/docs/tutorial/using-selenium-and-webdriver and I was able to capture the elements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.