How to set Firefox Profile: Selenium RC, .Net Client Driver?

后端 未结 2 1453
春和景丽
春和景丽 2021-02-11 06:11

I\'m using Selenium RC + .Net Client Driver. I\'ve created a Firefox profile in my c:\\selenium\\ directory. Here\'s my code:

Dim MySelenium As ISelenium = Nothi         


        
相关标签:
2条回答
  • 2021-02-11 06:27

    In Java you can create the Selenium Server programmatically and pass a File as the newFirefoxProfileTemplate configuration property:

    RemoteControlConfiguration rcc = new RemoteControlConfiguration();
    rcc.setPort(5499);
    rcc.setFirefoxProfileTemplate(newFirefoxProfileTemplate); // This is a File object
    SeleniumServer server = new SeleniumServer(rcc);
    
    server.start();
    

    Perhaps there are similar (or the same) vb.net classes available.

    0 讨论(0)
  • 2021-02-11 06:31

    You need to launch it via RC rather than in your code.

    So you would do

    java -jar selenium-server.jar -firefoxProfileTemplate c:\selenium\
    

    to launch the browser and then do

    Dim MySelenium As ISelenium = Nothing
    MySelenium = New DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com/")
    

    and that should launch Firefox for with the profile you want.

    0 讨论(0)
提交回复
热议问题