Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

CSS doesnt seem to load with selenium webdriver and Firefox

Options
  • 19-11-2013 8:11pm
    #1
    Closed Accounts Posts: 446 ✭✭


    Hi All
    I have a weird problem with selenium and firefox. It goes to a log on page, logs in, highlights a menu and clicks a link. All works fine until after the link is clicked, the browser doesn't load up any css. Any ideas?

    Here is the code for the Firefox initialisation. Have a feeling its something im doing wrong here.
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.firefox.FirefoxProfile;
    
    
    public class Driver {
            
        private static WebDriver Instance;
        
        public static void initialise(){
            Instance = new FirefoxDriver(new FirefoxProfile());            
        }
    
        public static WebDriver getInstance() {
            return Instance;
                
        }
    
        public static void close() {
            Instance.close();
            
        }
            
    }
    


Comments

  • Closed Accounts Posts: 446 ✭✭Devi


    Sorted it in the end with this.
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.firefox.FirefoxProfile;
    
    
    public class Driver {
            
        private static WebDriver Instance;
        
        public static void initialise(){
            FirefoxProfile newProfile = new FirefoxProfile();
            newProfile.setPreference("browser.cache.disk.enable", false);
            Instance = new FirefoxDriver(newProfile);            
        }
    
        public static WebDriver getInstance() {
            return Instance;
                
        }
    
        public static void close() {
            Instance.close();
            
        }
            
    }
    
    


Advertisement