1

Suppose I have a file with the exported test case. Can I build a browser extension (e.g, in Chrome) that uses some Selenium Core library which would simply run the test? I mean I'd just write something like

var selenium = require(<this is the library I'm looking for>)
var testCase ="<the html code of a test case exported form Selenium IDE>";
selenium.run(testCase);

I failed to find any simple JS library that would make it possible. Is it possible?

Novellizator
  • 13,633
  • 9
  • 43
  • 65
  • The whole point of test automation is to get ride of manual intervention. So why would you ask someone to manually load and run a suite in a browser? – Florent B. Jul 25 '16 at 10:19
  • @FlorentB. I want to have the test cases saved in my own (chrome) extension and run them as a complementary functionality of the extension, without manual intervention. So, do you think, is there a way? – Novellizator Jul 25 '16 at 12:06
  • Selenium doesn't have a JS library to automate Chrome. The chrome driver is implemented in c++: https://chromium.googlesource.com/chromium/src/+/master/chrome/test/chromedriver/ – Florent B. Jul 25 '16 at 12:28
  • @FlorentB. thank you! Still I fail to understand one thing. Selenium IDE has to be able to run the tests and selenium IDE must be written in Javascript, because it is a browser extension. How can this be possible? – Novellizator Jul 25 '16 at 12:54
  • The extension `Selenium IDE` has its own library to drive Firefox and doesn't share anything with `Selenium WebDriver`: http://stackoverflow.com/questions/19683100/why-do-we-use-webdriver-instead-of-selenium-ide – Florent B. Jul 25 '16 at 13:02
  • @FlorentB. ok, so let's talk about Selenium IDE. 1. Is there any way to run the tests written in selenium ide outside the selenium IDE (in firefox)? I'm looking for a domain-specific language similar to selenium IDE language (which is actually just a sequence of commands) that could run in javascript, preferably in a browser extension. – Novellizator Jul 25 '16 at 15:35
  • You should drop `Selenium IDE`, the recorder is not reliable. Have a look at Nightwatch (http://nightwatchjs.org/), it has a similar syntax. – Florent B. Jul 25 '16 at 15:55

0 Answers0