我正在尝试使用下面的脚本登录页面,但是在最大化窗口时它显示了下面的错误。
线程“主”org.openqa.selenium.WebDriverException 中的异常:未知错误:无法从未知错误获取自动化扩展:找不到页面:chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html(会话信息:chrome=57.0. 2987.133)(驱动程序信息:chromedriver = 2.27.440174(e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),平台=Windows NT 10.0.14393 x86_64)(警告:服务器未提供任何堆栈跟踪信息)命令持续时间或超时:10.13 秒构建信息:版本:'3。 .1',修订:'5234b32',时间:'2017-03-10 09:04:52 -0800' 系统信息:主机:'PRASANNAMULAY',ip:'172.21.31.80',os.name:'Windows 10 ',os.arch:'amd64',os.version:'10.0',java.version:'1.8.0_121'驱动程序信息:org.openqa.selenium.chrome.ChromeDriver Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9), userDataDir=C:\Users\ PRASAN~1\AppData\Local\Temp\scoped_dir12528_8422},takesHeapSnapshot=true,pageLoadStrategy=normal,databaseEnabled=false,handlesAlerts=true,hasTouchScreen=false,版本=57.0.2987.133,平台=XP,browserConnectionEnabled=false,nativeEvents=true 、acceptSslCerts=true、locationContextEnabled=true、webStorageEnabled=true、browserName=chrome、takeScreenshot=true、javascriptEnabled=true、cssSelectorsEnabled=true、unexpectedAlertBehaviour=}] 会话 ID:947fe656f81e3ced5cf5c932e81bc2f8 在 sun.reflect.NativeConstructorAccessorImpl。sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium 的 newInstance0(Native Method)。 remote.ErrorHandler.createThrowable(ErrorHandler.java:216) 在 org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168) 在 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:638)在 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:661) 在 org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:895) 在 pract_1_phase_3.Pract_1_phase_3.main(Pract_1_phase_3 .java:48)48)48)NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java: 216) 在 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:638) 在 org.openqa.selenium.remote.RemoteWebDriver 的 org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168) .execute(RemoteWebDriver.java:661) at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:895) at pract_1_phase_3.Pract_1_phase_3.main(Pract_1_phase_3.java:48)NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java: 216) 在 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:638) 在 org.openqa.selenium.remote.RemoteWebDriver 的 org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168) .execute(RemoteWebDriver.java:661) at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:895) at pract_1_phase_3.Pract_1_phase_3.main(Pract_1_phase_3.java:48)reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216) at org.openqa.selenium.remote .ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168) 在 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:638) 在 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:661) 在org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:895) 在 pract_1_phase_3.Pract_1_phase_3.main(Pract_1_phase_3.java:48)reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216) at org.openqa.selenium.remote .ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:638) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:661) at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:895) 在 pract_1_phase_3.Pract_1_phase_3.main(Pract_1_phase_3.java:48)newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168) at org.openqa.selenium。 remote.RemoteWebDriver.execute(RemoteWebDriver.java:638) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:661) at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver. java:895) 在 pract_1_phase_3.Pract_1_phase_3.main(Pract_1_phase_3.java:48)newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168) at org.openqa.selenium。 remote.RemoteWebDriver.execute(RemoteWebDriver.java:638) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:661) at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver. java:895) 在 pract_1_phase_3.Pract_1_phase_3.main(Pract_1_phase_3.java:48)java:638) 在 org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:895) 在 pract_1_phase_3.Pract_1_phase_3 的 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:661) .main(Pract_1_phase_3.java:48)java:638) 在 org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:895) 在 pract_1_phase_3.Pract_1_phase_3 的 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:661) .main(Pract_1_phase_3.java:48)
------------------------------------------------------------------------------------
My code is:-
package pract_1_phase_3;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.FluentWait;
import org.openqa.selenium.support.ui.Wait;
import com.google.common.base.Function;
public class Pract_1_phase_3 {
public static void main(String[] args)throws AWTException {
// System.setProperty("webdriver.gecko.driver","D:\\Gecko\\geckodriver.exe");
ChromeOptions options = new ChromeOptions();
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("credentials_enable_service", false);
prefs.put("password_manager_enabled", false);
options.setExperimentalOption("prefs", prefs);
ChromeDriver driver = new ChromeDriver(options);
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.get("http://demo.actitime.com/");
driver.manage().window().maximize();
driver.findElement(By.name("username")).sendKeys("admin");
driver.findElement(By.name("pwd")).sendKeys("manager");
driver.findElement(By.id("loginButton")).click();
Please tell me whats steps i need to do to resolve above issue
Thanks in advance