Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
375 views
in Selenium by
recategorized by

package org.openqa.selenium.example;

import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class GoogleSuggest {
    public static void main(String[] args) throws Exception {
        // The Firefox driver supports javascript
        WebDriver driver = new FirefoxDriver();

        // Go to the Google Suggest home page
        driver.get("http://www.google.com/webhp?complete=1&hl=en");

        // Enter the query string "Cheese"
        WebElement query = driver.findElement(By.name("q"));
        query.sendKeys("Cheese");

        // Sleep until the div we want is visible or 5 seconds is over
        long end = System.currentTimeMillis() + 5000;
        while (System.currentTimeMillis() < end) {
            WebElement resultsDiv = driver.findElement(By.className("gssb_e"));

            // If results have been returned, the results are displayed in a drop down.
            if (resultsDiv.isDisplayed()) {
              break;
            }
        }

        // And now list the suggestions
        List<WebElement> allSuggestions = driver.findElements(By.xpath("//td[@class='gssb_a gbqfsf']"));

        for (WebElement suggestion : allSuggestions) {
            System.out.println(suggestion.getText());
        }

        driver.quit();
    }
}
Error -

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
419587346786    addons.xpi-utils    DEBUG   Make addon app-profile:[email protected] visible
1419587346788   DeferredSave.extensions.json    DEBUG   Save changes
1419587346788   DeferredSave.extensions.json    DEBUG   Save changes
1419587346789   addons.xpi  DEBUG   New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1419587346793   addons.xpi-utils    DEBUG   Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1419587346793   DeferredSave.extensions.json    DEBUG   Save changes
1419587346793   DeferredSave.extensions.json    DEBUG   Save changes
1419587346793   addons.xpi  DEBUG   New add-on {D19CA586-DD6C-4a0a-96F8-14644F340D60} installed in winreg-app-global
1419587346803   addons.xpi-utils    DEBUG   Make addon winreg-app-global:{D19CA586-DD6C-4a0a-96F8-14644F340D60} visible
1419587346803   DeferredSave.extensions.json    DEBUG   Save changes
1419587346803   DeferredSave.extensions.json    DEBUG   Save changes
 

1 Answer

0 like 0 dislike
by
selected by
 
Best answer

Solution is already given here.

http://softwaretestingboard.com/qa/128/performing-parallel-execution-selenium-notconnectedexception

There are three possible solutions

1.) You need to upgrade your selenium libraries.

2.) Make sure that Symantec plugin is uninstalled.

3.) Downgrade your version.

here we do not have complete log. So, not sure which plugin is disturbing your execution. I would suggest you to remove all the plugins you have installed in firefox.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...