我正在我正在测试的同一系统上运行项目文件我正在使用 selenium web 驱动程序和 eclipse 来测试项目,但是当我运行 selenium 脚本来测试登录页面时显示错误。
**error** :
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
l,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},
"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1462864767739,"updateDate":1462864767739,"applyBackgroundUpdates":1,"skinnable":true,"size":22012,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"
{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"46.0.1","maxVersion":"46.0.1"}],"targetPlatforms":[],"seen":true}
so after this i had set the proxy
and tried but the result was same
but when i tried to copy the link and manually pasted it in Mozilla and searched it was successfully showing the login page
代码硒
包装测试
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class demo {
`public static void main(String[] args) {
WebDriver driver= new Firefox Driver();
driver.get("localhost:8080/Chaitanya");
driver.findElement(By.name("username")).send Keys("login");
driver.findElement(By.name("login.password")).send Keys("password");
`