Hey guys, I'm bit of a noob so please bear with me. I'm trying to open a lot of urls in internet explorer at once. About 40 urls.

I have an array of my urls and I'm using the following code:

for (int i = 0; i < urls.length; i++){
            java.awt.Desktop.getDesktop().browse(java.net.URI.create(urls[i]));
}

This works perfectly if I already have IE open. However if it's not open already it creates 40 new windows not tabs. I have tried to get around it by using the following:

for (int i = 0; i <= 9; i++){
            java.awt.Desktop.getDesktop().browse(java.net.URI.create(urls[i]));
            try {
                Thread.currentThread().sleep(200);
            } catch (InterruptedException ex) {
                Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

I imagine this is quite inefficient and poorly done. What I would like to do is open an ie window for the first url and then new tabs for the rest of the urls. Is this possible?

Use WebDriver/Selenium to do this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.