5

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

1

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
browser.element('#id');
browser.element('.class');
browser.element('.multiple.classes.to.find.element');
browser.element('//xpath');
0

CTRL+SHIFT+I

If that doesnt work read, "How to make developer tools appear".

0

If you are using WebdriverJS, then you need to run ./node_modules/.bin/chromedriver in this step.

1
  • 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
    Jan 8, 2017 at 0:31
0

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 that you have read and understand our privacy policy and code of conduct.

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