Good day to all, trying to make a program on the library FirefoDriver, created a new profile added. But when you start the program, when the program reaches the line

WebDriver d = new FirefoxDriver(myprofile); 

she stop here is the code:

 ProfilesIni profile = new ProfilesIni(); FirefoxProfile myprofile = profile.getProfile("profileToolsQA"); d = new FirefoxDriver(myprofile); 
  • Please show me the error code - Paulo Berezini
  • @PavelBereznichenko, no error, just the program stops when WebDriver d = new FirefoxDriver (myprofile); and does not go on - as1andrey1
  • one
    most likely a problem with either FirefoxDriver or Firefox Profile - Paulo Berezini
  • @PavelBereznichenko, what is it like? and what to do with it ? - as1andrey1
  • Try to check more carefully whether these objects are created, I suggest debugging - Paulo Berezini

1 answer 1

You need:

  1. Remove unnecessary add-ons from the Extensions folder (in the profile folder) (names like these {32ggfd71-3d4e-4522-84-77ggr6fda0b4d89}, if not helping, then 2
  2. Create a new (clean) profile

An example should be written in profiles.ini (path to the profile windows7% APPDATA% \ Roaming \ Mozilla \ Firefox):

 [ProfileN] Name=selenium IsRelative=0 Path=D:\Selenium 

and you need to call it like this:

 ProfilesIni allProfiles = new ProfilesIni(); FirefoxProfile profile = allProfiles.getProfile("selenium"); WebDriver driver = FirefoxDriver(profile); 

Profile name must match the name where we call it.

  • I created a new profile, deleted everything from the C: \ Users \ Andrey \ AppData \ Roaming \ Mozilla \ Extensions folder, but the error is the same: "Your Firefox profile could not be loaded. It may be missing or unavailable.". But I discovered that there is no profiles.ini file in the profile folder, maybe all the errors are due to this? - as1andrey1
  • @ as1andrey1 yes because of this - Paulo Berezini
  • I found the file (I looked in the wrong place), I write everything correctly - as1andrey1
  • @ as1andrey1 can show what is written in profiles.ini? - Paulo Berezini
  • [General] StartWithLastProfile = 1 [Profile0] Name = default IsRelative = 1 Path = Profiles / nahd6ha2.default [Profile1] Name = user IsRelative = 1 Path = Profiles / t6iboeiu.user [Profile2] Name = profileToolsQA IsRelative = 1 Path = Profiles /mmqrroxe.profileToolsQA Default = 0 - as1andrey1