I ran into a problem. Every time I run my test class, it shows the following error:
Testsuite: com.lo.test.selenium.AssignCampaignTestCase Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 46.991 sec ------------- Standard Error ----------------- org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: Xlib: extension "RANDR" missing on display ":99". *** LOG addons.manager: Application has been upgraded *** LOG addons.xpi: startup *** LOG addons.xpi: Ignoring file entry whose name is not a valid add-on ID: /tmp/anonymous4942696774897131989webdriver-profile/extensions/webdriver-staging *** LOG addons.xpi: checkForChanges *** LOG addons.xpi-utils: Opening database *** LOG addons.xpi-utils: Creating database schema *** LOG addons.xpi: New add-on fxdriver@googlecode.com installed in app-profile *** LOG addons.xpi: New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global *** LOG addons.xpi: Updating database with changes to installed add-ons *** LOG addons.xpi-utils: Updating add-on states *** LOG addons.xpi-utils: Writing add-ons list *** LOG addons.manager: shutdown *** LOG addons.xpi: shutdown *** LOG addons.xpi-utils: shutdown *** LOG addons.xpi-utils: Database closed Xlib: extension "RANDR" missing on display ":99". *** LOG addons.xpi: startup *** LOG addons.xpi: Ignoring file entry whose name is not a valid add-on ID: /tmp/anonymous4942696774897131989webdriver-profile/extensions/webdriver-staging *** LOG addons.xpi: checkForChanges *** LOG addons.xpi: No changes found at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:109) at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:245) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:109)
My test class:
package com.lo.test.selenium; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.Properties; import java.util.ResourceBundle; import javax.mail.Flags; import javax.mail.Folder; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.NoSuchProviderException; import javax.mail.Session; import javax.mail.Store; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.Select; import org.openqa.selenium.support.ui.WebDriverWait; public class MyExampleTestCase { private static ResourceBundle rb = ResourceBundle.getBundle("global-messages"); static WebDriver driver = new FirefoxDriver();
Update:
I tried the code below, but it still shows the same error after executing this code, and also showed some error with this code
Xvfb :21 -screen 0 1024x768x24 -extension RANDR &
It seems this code is not working properly. Can anyone help me with this?
java firefox selenium selenium-webdriver
Dan
source share