我无法通过硒脚本关闭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'关闭窗口。我无法找到相同的。如果任何人有解决这个问题,请让我知道。 –