我無法通過硒腳本關閉Internet Explorer,我嘗試了每個解決方案來終止IEDriver任務和Iexplorer.exe。Internet Explorer不通過硒腳本關閉每個解決方案
我也試過解決方案:Selenium Test 2後Internet Explorer 11沒有關閉,但它仍然不適用於我。 我使用下面, 硒3.4, IE:11.1358.14393.0, InternetExplorerServerDriver:3.4.0
下面是我的代碼。
import java.io.IOException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
public class Tc03_IEDriver_First_use {
public static void main(String[] args) throws Exception {
//Set IEDriver Properties
System.setProperty("webdriver.ie.driver", "D:\\Rohit Bhatkar\\Selenium Jars\\IEDriverServer_x64_3.4.0\\IEDriverServer.exe");
//Set desired Capabilities of IE. these statements removes an zoomsetting error.
//You Can set Zoom mannually as, Go To View Menu on IE > Click On Zoom > Select 100%
DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
caps.setCapability("ignoreZoomSetting", true);
//Create IEDriver obj, Open Browser, Open URL, Close the Browser
WebDriver obj1= new InternetExplorerDriver(caps);
obj1.manage().window().maximize();
obj1.get("https://www.google.com");
obj1.quit(); //IE not Closing. Steel need to do some work to close the browser
}
}
你好, 我試圖做到此外,它不與obj1.close() –
感謝您回答問題。 我之前嘗試過。腳本在控制檯上不顯示任何錯誤。 開始InternetExplorerDriver服務器(64位) 3.4.0.0 偵聽端口14419 只有本地連接被允許 2017年7月25日下午三點27分15秒org.openqa.selenium.remote.ProtocolHandshake了createSession 信息:檢測方言:OSS –
你好, 我發現問題,如果我試圖關閉瀏覽器而不打開任何網址,它會關閉瀏覽器,但是,一旦瀏覽器標題改變,它會尋找標題'WebDriver'關閉窗口。我無法找到相同的。如果任何人有解決這個問題,請讓我知道。 –