Open firefox window in selenium with firefox addons loaded?

后端 未结 2 2028
梦谈多话
梦谈多话 2020-12-10 15:28

when I run my test in selenium, the newly opened firefox window is opened without my installed addons like xpathchecker.

Is it possible to setup selenium so that it

相关标签:
2条回答
  • 2020-12-10 15:50

    If you are using selenium remote control,

    1. you might need to create a separate profile for testing with your addons.
    2. After that you can install the addons in that new profile. Note down the path of the profile folder in profile manager or check here to locate your profile folder
    3. Then when you start selenium, use

      -firefoxProfileTemplate "path to the profile"

    to specify the location of the profile with addons installed.

    0 讨论(0)
  • 2020-12-10 16:13

    Just to add. When running RC from java you can use:

    RemoteControlConfiguration server_preferences = new RemoteControlConfiguration();  
    File f = new File('/home/user/.mozilla/firefox/qa/'); // 'qa' is my profile folder name
    server_preferences.setFirefoxProfileTemplate(f);  
    (...)   
    myServer = new SeleniumServer(server_preferences);  
    myServer.start();  
    
    0 讨论(0)
提交回复
热议问题