4

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?

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');
| improve this answer | |
0

CTRL+SHIFT+I

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

| improve this answer | |
0

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

| improve this answer | |
  • 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 '17 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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