Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

CSS doesnt seem to load with selenium webdriver and Firefox

  • 19-11-2013 07: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