Unable to focus when using ChromeDriver - selenium

I am getting Webdriver exception "Failed to send keys because cannot focus on element" while using ChromeDriver.
I have also observed that if I bring up any other window (say eclipse) in front of the chrome browser and then minimize it, the ChromeDriver is able to resume execution on the Chrome browser but gets stuck again on the next input field.
Can anyone please help suggest some solution

Related

Selenium chrome driver throws password field not intractable error

I am using selenium chrome driver nugget package with . Net core for browser automation. I am facing an issue whenever I try to set text inside password field. I tried to implement most of the suggestions on stackoverflow and other sites but nothing seems working. I tied to use wait.until elements is visible and wait.until elements is clickable and tried sleeping the current thread for considerable time but none of the solution is working.
I am not getting this error while debugging it. Please help if you have solution around it.

How to hide the preliminary "data:," that shows up in the url bar when initiating Google Chrome using ChromeDriver?

from selenium import webdriver
driver = webdriver.Chrome(options=chrome_options)
driver.get(my_website)
The above code opens my website but only after loading a tab with the title data:, for a second or two. How do I hide it?
Your code successfully opens the website properly through google-chrome after loading a tab with the title data:, for a second or two, is perfectly fine.
The main concern is, your program shouldn't be stuck with data:, in the url bar. Incase this situation happens the simplest solution would be to:
Check if the url is properly formatted. As an example, you have mentioned the protocol along with the actual url as follows:
http://localhost:3000
You are using compatibile version of binaries in terms of Google Chrome Browser and ChromeDriver
References
You can find a couple of relevant discussions in:
How to work with a specific version of ChromeDriver while Chrome Browser gets updated automatically through Python selenium
Selenium for ChromeDriver and Chrome Browser and the log message “Only local connections are allowed”
WebDriverException: Message: Service /usr/lib/chromium-browser/chromedriver unexpectedly exited on Raspberry-Pi with ChromeDriver and Selenium
RemoteDisconnected(“Remote end closed connection without” http.client.RemoteDisconnected: Remote end closed connection without response

Selenium Chrome Driver hangs on "getCurrentUrl()" of an XML page. When I manually refresh the hanging page, the code finishes executing

Running on Windows 7 Enterprise, 64-Bit OS, with Chrome Version 65.0.3325.181 (Official Build) (64-bit) and ChromeDriver version 2.37.
The same code runs flawlessly in Firefox. I am using webdriver to fill out a page (say page 1) that will generate an XML link. When I click the link from page 1 it will open the XML page in a new window. My code switches to the window and calls "getCurrentUrl()". Once it hits this snippet of code, it hangs for several minutes and returns:
[1523382059.135][SEVERE]: Timed out receiving message from renderer:
300.000 [1523382059.138][SEVERE]: Timed out receiving message from renderer: -0.002.
However, if I manually refresh the page, it will return the URL and finish executing.I have tried telling selenium to send control + F5, as well as the refresh methods and even telling it to get(getCurrentUrl() ).
Could this be an issue with proxys or maybe an issue with pulling the page, since it is just raw XML?
Thanks for the time and help.
I have recently had issues with Selenium and the chrome driver myself. Even though its not ideal have you tried using a implicit or explicit wait? Thread.sleep() has worked for me in the past when all else failed.

Test Case in Selenium is not working for a Java Script Pop Up

I installed the selenium plugin in Firefox for automating a monitoring process. When i record the test case and rerun it it fails for pop up validation in the end. So i'm i'm confirming the monitoring as successful when i got a pop up at the end saying "successful". So i record the test case using selenium and when i rerun it at the end when its waiting for pop up to come two things are happening
the pop up in the record playback its not coming up.
the test case is failing for the pop up.
Please also suggest if i can use IE with selenium
Here You can check very good and easy example for how to handle javascript popup using selenum web driver : Selenium Webdriver for Javascript popup
To use IE with selenium web driver do following :
1 - Download IE driver of selenium web driver from HERE
2 - You can all IE driver from selenium web driver as per below :
System.setProperty("webdriver.ie.driver", "D:/IEDriver.exe");
InternetExplorerDriver IEDriver=new InternetExplorerDriver();
Note : In above code "D:/IEDriver.exe" is example path , you please set actual path where you have put your IE drivers.

Selenium webdriver "Error communicating with remote browser. It may have died" when I run test in parralel

I am working on client side. I have created around 150 test scripts. But during execution, after some script execution, Selenium throws below error and it close the browser. Time is not a fix for this error. It comes when I am executing all the test scripts together in parallel.
The error shows on Google Chrome and Firefox browsers. I am using selenium-server-standalone-2.26.0.jar file and doing execution on FF 13.0.1 version. I have also tried with FF version 14, but I get the same error. My client is not happy with this error because we dont have workaround for this issue.
**Error message:**
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Error communicating with the remote browser. It may have died
I think this will happen when you dealing with popup window.
Example
Working on main window clicking on something leads to open a new popup
switch the control to popup window & do your operations in pop-up
Most of the cases popup will be closed automatically after some action performed in it. (EX : Login with facebook option most of site now a days, after entering user credential no need to close that popup it will be closed automatically after submitting proper credentials)
After this you need to switch the control to main window again otherwise it will throws above exception.
I think your doing some operations without having the control over a window.