简体   繁体   中英

Selenium Webdriver (Java) connect/interoperate with a Firefox extension/plugin

i am looking for a way to connect out of the Selenium Webdriver to a Firefox extension/plugin. I want to start a function from the firefox extension out of the api of the selenium Webdriver. Could this be possible? I know that i can call javascript code which is inside a page, but not inside a firefox extension.

If it is not possible with selenium webdriver, is there another way to connect, maybe with java?

Thanks a lot for your help!

One of way, how you could do this, is:

  • Create firefox profile and name it somehow you know what it is. eg SELENIUM
  • Install addon to this profile. In general, make that profile suitable for the tests.
  • When initializing the Webdriver:

      ProfilesIni allProfiles = new ProfilesIni(); FirefoxProfile desiredProfile = allProfiles.getProfile("SELENIUM"); WebDriver driver = new FirefoxDriver(desiredProfile); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM