'Error on Page' while running Selenium script in IE8 - selenium

I am trying to run Selenium Webdriver script in IE8 and soon as the page load is complete I am getting 'Error on Page', which eventually stops the execution of the script. Please note that if I launch the same URL manually, I don't see any error.
This is what I have tried so far
Unchecked Enable Protected Mode
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
driver = new InternetExplorerDriver(capabilities);
driver.get(AppURL);
driver.navigate().to("javascript:document.getElementById('overridelink').click()");
Nothing worked so far, however my script runs perfectly for FF and Chrome.
Please let me know if there is any possible solution to this issue, I am using Windows 7

This is expected. Selenium won't run properly unless you have the protected mode disabled in the internet explorer options.
Disable it and it should work fine.

Related

Internet Explorer Driver not working in Selenium

Iam trying to test simple rediffmail login page by sending username and password using Chrome and Explorer in Eclipse. Till yesterday, it was working fine but suddenly same code not working in Explorer(working fine in Chrome). Getting the "Configuration Failures: 1" error.
-Windows Operating system : 7
-Internet Explorer version : 8.0
-IEDriverServer_Win32_3.0.0
My code is follows :
System.setProperty("webdriver.ie.driver","C:\\IEDriverServer_Win32_3.0.0\\IEDriverServer.exe");
driver = new InternetExplorerDriver();
driver.get("https://mail.rediff.com/cgi-bin/login.cgi");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElement(By.xpath("//*[#id='login1']")).sendKeys("sample.3400");
driver.findElement(By.xpath("//*[#id='password']")).sendKeys("edutorignitor12345");
I tried to google the issue but no solution.
NOTE: Element Locators are correct as same code is running with Chrome.
I had faced a similar issue. Turned out that the driver needed to be updated. Try that.

Selenium IE Webdriver send slowkeys even though changed to 32Bit

I have a serious Problem, and i tried about 20 workarounds which completely failed to work as a solution for me.
MainProblem: I execute a testsuite parallel on 3 different browsers, Chrome, Firefox and IE11. While sendKeys() works perfectly fine on chrome and Firefox, on IE every letter takes about 5 seconds to appear, so a normal login-procedure which takes about 2 sec on chrome takes about 50 on IE...
I work on a mac. On the Mac, i have a WindowsPC (Win10) in a VM via Parallels. On this, i installed JDK, Eclipse, and try to automate a webpage via Selenium+Testng.
IE Version: 11.192.16299.0
I set the security level to low for trusted and local intranet, i removed the save-mode checkbox. I got the well known slow-sendKeys-Problem. But for most of the internet it worked with changing the IEWebdriver from 64-> 32Bit. It simply doesnt make any difference and i struggle here.
I really need help. Please let me know if you need any insight, logs or whatever, i try to provide with everything fast.
Best Greets!
By setting up the following options It should resolve the problem:
System.setProperty("webdriver.ie.driver", "./path/IEDriverServer.exe");
InternetExplorerOptions options = new InternetExplorerOptions();
options.introduceFlakinessByIgnoringSecurityDomains();
options.requireWindowFocus();
WebDriver driver = new InternetExplorerDriver(options);

Button is not clicked unless I click on it twice in Firefox, using selenium webdriver and C#

I have a button in a web application which I want to click. I am using Selenium WebDriver, C# and Firefox version 47.0.1.
I tried using explicit wait and also tried using Actions class. But nothing works.
It only works for firefox when I add the below code (click twice)
_NextButton.Click();
_NextButton.Click();
However, it works fine in Chrome browser with : _NextButton.Click();
and fails in chrome for the code used for executing on Firefox.
Kindly help me resolve this issue.
Sometimes their is some problems with IE11 and chrome in selenium is not able to work as expected. so I use double click instead of click in certain scenarios.
Actions action = new Actions(driver); action.moveToElement(driver.findElement(By...path..."))).doubleClick().perform();

Firefox Webdriver is extremely slow

We use the selenium webdriver dlls set up to run my automation suite. I encounter this problem when runnning tests in Firefox only. The tests in Firefox run very slow , taking 3-4 minutes to load pages, However, when I run the same test on the same machine using Firefox browser manually I don't encounter this slowness. At times while running automation on Firefox, we also get "Connection was reset" page. Also, the same tests run fine in Chrome and IE.
We use the following environment:
Firefox version 28, 37 (proxy is set to use system settings)
Webdriver (dlls) version 2.45
Windows 7
Earlier we used to run the same set up in Windows XP using Firefox version 14,16, and Webdriver version 2.37, we didn't experience this issue.
We invoke Firefox using the following code :
Proxy proxy = new Proxy();
proxy.Kind = ProxyKind.System;
FirefoxProfile profile = new FirefoxProfile();
profile.SetProxyPreferences(proxy);
RemoteWebDriver dr = new FirefoxDriver(new FirefoxBinary(#"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"), profile, TimeSpan.FromSeconds(120));
dr.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(3));
dr.Manage().Window.Maximize();
dr.Manage().Cookies.DeleteAllCookies();
dr.Navigate().GoToUrl(WebSiteUrl);
remaining tests steps......
Please can someone help me resolve this issue.
Thanks in advance.
This is how I solved the "extremely slow FirefoxDriver" problem:
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService();
service.Host = "::1";
IWebDriver driver = new FirefoxDriver(service);
The above code forces the geckodriver to use the IPv6 protocol, which works many times faster for the interactions with the UI elements.
Probably won't do you any good now, but I had the same problem with Firefox 45 and Webdriver 2.15. Turned the problem was the implicit wait setup. In my case, I had:
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
This one line was taking 190 seconds (yes, more than 3 minutes!) to execute. Removing it cut the startup time to under 8 seconds!

Selenium grid to remote webdriver(chrome) hangs on get

I have a selenium grid with nodes on virtual machine. I can connect, open browser and close it but when i try navigating to a page it hangs on Executing: [get: http://google.com]
I use the latest verions of selenium, chromedriver and java.
Declaration:
DesiredCapabilities capabilities = DesiredCapabilities.Chrome();
driver = new RemoteWebDriver(new Uri(#"http://xxx.xx.xx.xxx:6000/wd/hub"), capabilities);
then i try to use it when i click a button on my win form:
driver.Navigate().GoToUrl("http://www.google.com");
I can see the node gets the command and logs Executing:[get:htttp://www.google.com] but just hangs. Url doesn't change in browser(its "data:," all the time )
I use windows 7 x64 and try to control browser on windows 7 x32. (if i connect to node on my pc the code works fine)
Any ideas?
Thanks!
I am seeing the exact issue with Safari (python). I am using selenium standalone server v2.47.1. My current workaround is to use JS:
"driver.execute_script("window.location.href = '{0}';".format(url))"
I also observed that if you don't set a homepage on Safari or have it default to load the homepage on new tab/window, the webdriver acts up and hangs on 'get' method.