1

I successfully got Selenium tests to work with my Chrome extension. But still I have an issue where the ID of the extension should be received through the Chrome API.

Why do I need that? Since the project is within Git I want to ensure that my code buddy can run the tests without configuring much. Everything works fine BUT the ID for the extension differs from every machine.

My ID is:

chrome-extension://dafanlbggefkfnbekjceijjhgcancpik/html/options.html

What do I need? To receive this ID dynamically I need access to chrome.runtime.id. Which is not trivial since the Chrome API is not accessible for me within my Selenium test code.

var extensionID = chrome.runtime.id;
var urlToOptionsPage = 'chrome-extension://'+ extensionID +'/html/options.html';

That's what I actually want to achieve so my Selenium tests can open the proper locale extension URL.

Does anybody have a clue what I need to do within the manifest.json or within Selenium configs or another workaround?

halfer
  • 19,824
  • 17
  • 99
  • 186
xetra11
  • 7,671
  • 14
  • 84
  • 159
  • 1
    Possible duplicate of [Chromedriver extension id does not match key in manifest.json](http://stackoverflow.com/questions/26899725/chromedriver-extension-id-does-not-match-key-in-manifest-json) – Haibara Ai Apr 15 '16 at 10:37
  • Thanks for pointing that out. Unfortunately I couldn't find a solution there and my case is not exactly similar to those – xetra11 Apr 15 '16 at 11:10
  • I have the same problem using the "Load unpacked extension…" button in the Extensions window. Some consolation: Upon relaunch, Chrome 58 reloads my unpacked extension with the same identifier. – Jerry Krinock Apr 20 '17 at 15:16

0 Answers0