Tag: internet explorer

无法使用IEDriver单击IE上的链接

我正在使用的代码如下所示。 多浏览器 package com; import java.io.File; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.DesiredCapabilities; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Parameters; import org.testng.annotations.Test; public class MultiBrowser { public WebDriver driver; // Passing Browser parameter from TestNG xml @Parameters(“browser”) @BeforeClass public void beforeTest(String browser) { // If the browser is Firefox, then do this if(browser.equalsIgnoreCase(“firefox”)) […]

无法使用JRE 7u51在Internet Explorer 11中运行Java Applet

今天我将Java版本更新为7u51。 安装完成后,我清除了Java Cache,浏览器的Cache,并登录到一个安全的网站,该网站使用Applet为用户提供某些附加服务。 小程序不再工作了。 我访问了http://www.java.com来检查在Internet Explorer中检测到的Java版本,java网站说: We are unable to verify if Java is currently installed and enabled in your browser. 其他浏览器可以检查Java,并且提到的applet按预期工作: 由于applet在其他浏览器中按预期工作,我可以假设问题不是Applet及其部署文件/进程,而是JRE 7u51与IE 11的兼容性。我想知道是否有任何解决方法。 作为额外措施,我使用java.com工具卸载任何以前和不安全的JRE版本(使用谷歌浏览器)。 仔细检查IE 11后,我可以看到Java Addons已启用并版本化为7u51: 我知道IE已经改进了; 即便如此,我们建议客户使用谷歌浏览器或Firefox,因为这些浏览器已被certificate与我们的网络应用程序更兼容。 不幸的是,由于对程序使用等的共同组织限制,我们无法强迫客户使用某些浏览器。 在此先感谢您的帮助。 更新(2014年1月20日): 以下屏幕截图显示了为“java.com”配置了兼容性视图的Internet Explorer 11。 在这种情况下,它无法解决问题。

无法使用Selenium在IE 11上的关闭窗口中找到元素

我正在尝试使用Selenium WebDriver在Internet Explorer 11上运行测试。 代码是: System.setProperty(“webdriver.ie.driver”, “Path/to//IEDriverServer.exe”); WebDriver driver = new InternetExplorerDriver(); driver.get(“www.google.com”); driver.findElement(By.name(“q”)); 我收到这个错误: 已启动InternetExplorerDriver服务器(64位)2.46.0.0正在侦听端口43760线程“main”中的exceptionorg.openqa.selenium.NoSuchWindowException:无法在关闭的窗口中找到元素(警告:服务器未提供任何堆栈跟踪信息)命令持续时间或超时:15毫秒构建信息:版本:’2.46.0’,修订版:’61506a4624b13675f24581e453592342b7485d71’,时间:’2015-06-04 10:22:50’系统信息:主机:’user1-PC’,ip:’ 10.0.23.71’,os.name:’Windows 7’,os.arch:’amd64’,os.version:’6.1’,java.version:’1.8.0_45’驱动程序信息:org.openqa.selenium.ie。 InternetExplorerDriver Capabilities [{browserAttachTimeout = 0,enablePersistentHover = true,ie.forceCreateProcessApi = false,pageLoadStrategy = normal,ie.usePerProcessProxy = false,ignoreZoomSetting = false,handlesAlerts = true,version = 11,platform = WINDOWS,nativeEvents = true,ie。 ensureCleanSession = false,elementScrollBehavior = 0,ie.browserCommandLineSwitches =,requireWindowFocus = false,browserName = internet explorer,initi alBrowserUrl = […]

来自IE中的servlet的持久性cookie

我有一个从servlet生成的cookie,我想要持久化 – 也就是说,设置cookie,关闭IE,重新启动它,并且仍然能够读取cookie。 我正在使用的代码如下: HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance() .getExternalContext().getResponse(); Cookie cookie = new Cookie(“someKey”, “someValue”); cookie.setMaxAge(7 * 24 * 60 * 60); response.addCookie(cookie); 这在firefox中运行良好,但在IE 6/7中,cookie不会在浏览器重启之间保存。 我已经检查了我在设置中可以想到的所有内容,但无法弄清楚导致cookie被删除的原因。 据我所知,使用正数调用setMaxAge会使cookie持久化。 任何想法为什么会出错? 编辑 我已经使用Olaf建议的更多信息技巧validation了cookie是否正在尝试设置为会话cookie,而不是持久cookie; 最大年龄设置为“会话结束”。 所以看起来似乎没有为IE设置最大年龄 – 我已经validation在Firefox中,最大年龄设置正确。 我仍然不知道发生了什么。

如何在Selenium WebDriver中使用不同版本的IE(IE6,7,8,9和10)和Java

我从以下url下载了“IEDriverServer_Win32_2.28.0.zip”: http : //code.google.com/p/selenium/downloads/detail? name =IEDriverServer_Win32_2.28.0.zip&can = 2&q = 在文件夹中解压缩zip文件后,我在WebDriver Java代码中使用了该路径,如下所示: File file = new File(“E:\\Global Blue\\globalblue-selenium-test\\gb-selenium-test\\lib\\IEDriverServer_Win32_2.28.0\\IEDriverServer.exe”); System.setProperty(“webdriver.ie.driver”, file.getAbsolutePath()); driver = new InternetExplorerDriver(); 测试在Internet Explorer中运行良好。 如何在我的Selenium WebDriver测试中使用不同版本的IE(IE6,7,8,9和10)?

Selenium – IE 11中的NoSuchWindowException

我试图在IE11中使用selenium自动化网页。 我已将保护模式设置设置为相同级别,缩放级别为100%。 在运行测试时,它会打开网站,但之后会提供例外。 以下是使用的代码。 File file = new File(“C:\\Users\\Desktop\\IEDriverServer.exe”); System.setProperty(“webdriver.ie.driver”, file.getAbsolutePath() ); DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer(); capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true); WebDriver driver = new InternetExplorerDriver(capabilities); driver.get(“http://www.google.com”); 和exception堆栈跟踪 Started InternetExplorerDriver server (32-bit) 2.39.0.0 Listening on port 38122 Jul 11, 2014 1:50:02 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute INFO: I/O exception (java.net.SocketException) caught when processing request: Software caused connection abort: recv failed […]

如何在多个浏览器中运行Selenium测试,以便使用Java进行跨浏览器测试?

我正在使用Selenium WebDriver和Java和TestNG框架。 我想在一个代码中一次使用Firefox,IE,Chrome进行跨浏览器测试。 我只能将Firefox初始化为 driver = new FirefoxDriver(); 但无法以相同的方式初始化其他浏览器。 例如: driver = new InternetExplorerDriver(); 给出错误InternetExplorerDriver cannot be resolved. driver = new ChromeDriver(); 给出错误ChromeDriver cannot be resolved. 如何初始化IE和Chrome并在所有需要的浏览器中执行我的测试?

GWT CellTable CheckboxCell在IE8中不起作用

我有一个带CheckboxCell的CellTable。 我已经添加了以下处理程序: private static Column m_checkColumn = new Column(new CheckboxCell(true, false)) { @Override public Boolean getValue(AIDataRecord object) { // Get the value from the selection model. return object.isSelected(); } @Override public void onBrowserEvent(Context context, Element elem, AIDataRecord object, NativeEvent event) { System.out.println(“Browser Event Called”); super.onBrowserEvent(context, elem, object, event); String eventType = event.getType(); if (“change”.equals(eventType)) { […]

在Selenium WebDriver中实现InternetExplorerDriver期间发生NoSuchElementException

目前,我正在研究WebDriver来调用IE浏览器来运行测试。 但是当我尝试运行下面的简单示例时,我收到了NoSuchElementException 。 但是,如果我使用Chrome驱动程序或Firefox驱动程序,代码工作正常。 任何想法或想法将不胜感激。 Jar: selenium-server-standalone-2.5.0.jar 码: import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.DesiredCapabilities; public static void main(String[] args) throws InterruptedException { DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer(); ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true); WebDriver driver = new InternetExplorerDriver(ieCapabilities); driver.get(“www.google.com”); driver.findElement(By.name(“q”)); } 错误信息: Exception in thread “main” org.openqa.selenium.NoSuchElementException: Unable to find element with name == q (WARNING: The server […]

Selenium:将Internet Explorer中的文件下载到没有直接链接的指定文件夹,没有Windows窗体,没有AutoIt或Robot

我经常遇到一个问题,如何在IE中下载文件。 与Firefox的Chrome相比,您不仅可以指定所需的文件夹,而且所有文件都将下载到该文件夹​​。 您还需要与本机Windows窗体等进行交互。 有多种选择,比如使用AutoIt,使用键盘命令,机器人等……但是所有这些选项都不稳定,它们需要使用冗余库进行显式等待,并且在并行运行测试时不合适。 另一个问题是,该怎么办,如果文件没有通过直接链接下载,但链接是从javascript命令生成或从服务器接收,并且无法从html中提取。 所有这些问题都可以解决,在这里,我将展示如何做到这一点。 解决方案是用c#编写的,我相信同样可以在java中实现