Selenium脚本在Firefox安全模式下运行

时间:2018-07-10 11:27:57

标签: selenium-webdriver selenium-chromedriver

问题1: 我正在TestGN套件中运行脚本。但是打开和关闭脚本都在安全模式下运行。如何在“ Firefox”浏览器中永久停止以安全模式运行脚本

问题2: 在chrome浏览器中,autoit脚本未运行。但是,如果我手动运行autoit exe,它将正常运行。

以下是我的自动脚本:

Opt("WinSearchChildren",1)
$iSleep = 2000
_WinWaitActivate("EyComplyUi - Google Chrome","")
Send("{SHIFTDOWN}e{SHIFTUP}{SHIFTDOWN}y{SHIFTUP}{SHIFTDOWN}gax{SHIFTUP}\eycdemo{TAB}{SHIFTDOWN}p{SHIFTUP}{SHIFTDOWN}2{SHIFTUP}ssw{SHIFTDOWN}1{SHIFTUP}{TAB}{ENTER}")

下面是硒脚本:

@BeforeMethod
      public void Portal_login() throws Exception {
          System.setProperty("webdriver.chrome.driver","C://chromedriver.exe");
          driver = new ChromeDriver();
          driver.get(Portalurl);
          driver.manage().window().maximize();
          driver.manage().deleteAllCookies();
          driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
          driver.findElement(By.id("userNameInput")).sendKeys(" ssouser");
            // Enter Password
            driver.findElement(By.id("passwordInput")).sendKeys("pass");
            // Wait For Page To Load
            driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
            // Click on 'Sign In' button
            driver.findElement(By.id("submitButton")).click();  
            //Privacy notice
            //driver.findElement(By.xpath("//*[text()='I Agree']")).click();
            // Windows Authentication handling from FireFox
            //Thread.sleep(1000);
            // Wait For Page To Load
            driver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS);
            try {
                Runtime.getRuntime().exec("C://Users//somanath.kamble//Documents//DashboardChrome.exe");
                } catch (Exception e) {
                    Runtime.getRuntime().exec("C://Users//somanath.kamble//Documents//DashboardChrome.exe");

                }



      }

0 个答案:

没有答案