ChromeDriver can't click button in headless mode only - selenium

I'm trying to use ChromeDriver to login automatically on badoo com on page /signin/. My app types login and password and clicks the "Login" button. It works but when I use headless mode in chromium, clicking the "Login" button somehow doesn't work. Sometimes it kinda works but shows "incorrect credentials" error but often nothing happens at all. I tried clicking on element coordinates instead of element itself, tried sending "Enter" key press but nothing helps. How can I make it work in headless mode?

Related

Firefox stuck at Login operation with Selenium-Webdriver

I'm trying to execute Selenium-webdriver code written in Ruby for firefox.
I'm using firefox 45.0.1 because I use ruby 2.1.10 and Selenium-WEbdriver-2.53.4
When I execute Selenium opens firefox, enters address and enters username and password and hits login button.
But after that It stays there with loading symbol near login and also browser says
Transferring data from 34.23.23.2
Selenium is stuck here for 5 minutes and then exists saying timeout and gives below error.
**1.1) Failure/Error:**
#browser.span(:text=>'Login').wait_while_present(10000)
Net::ReadTimeout:
Net::ReadTimeout
When I manually open firefox new tab when selenium opens the firefox and try to login manually, I see the same issue. But When I open firefox manually from desktop and login it works. Please tell me what I'm I missing here.
I suspect that some websites detect when a automated test is running and behave differently, also when selenium starts up it uses a default profile and when you open it manualy your profile is loaded. Cant say for sure that's your problem.

How we can find the Xpath of loader image in webapplication

in some web application when we click some radio button the page is getting loaded at that time some loader icon is getting displayed . the issue is that the loader image is appearing only for few seconds and getting disappeared. How we can find the xpath for the loader image
If your page is slower this will give you more time to look for the XPath. You can try to throttle the network (make your browser temporarily slower). This could be done from Chrome DevTools. For Windows:
Press F12 to open Devtools.
Click "More tools" (three dots menu).
Click "Network conditions".
Select network throttling profile.

Google Signin with IE11 & Edge not working

I'm trying to add Google Signin to our login page. I've followed the code supplied by Google, as well as a GitHub project that I used for code example. Both work perfect on Chrome, FireFox, Safari, but I can't get it to work on IE11 or Edge.
The GitHub project is at https://github.com/googleplus/gplus-quickstart-javascript. This project uses Google's newer apis.google.com, however I've also tried plus.google.com as suggested in another post. Neither work.
I added a data-onfailure function to the button, and get an error "popup_blocked_by_browser" even though the popup blocker is turned off in the browser. Even though I get this popup error, I do get a popup that asks which Google account to use, but when I choose one, I get the "The webpage your are viewing is trying to close the window" message. If I choose Yes, the window closes, but I don't get logged in.
Anyone have any advice for getting this to work in IE or Edge?
I ran into this problem on IE 11 with Windows 10.
I fixed it and then it happened again after receiving Windows Updates - annoying!
Here is what fixed it for me; it was an IE Setting.
Go to:
IE -> Internet Options -> Security
Check "Apply" and then "OK" To exit.
IE Settings Screen Shot
Finally, restart IE.

Page keeps on loading in Chrome Driver

I m working on a web application automation and I have this issue with Chrome driver. The page keeps on loading and it does not move to the next action.
For eg: The successful login scenario.
The application is launched and the username passwords are keyed in Successfully and the home page is loaded.
The home page keeps on loading that it does not move to the next button click (eg. log out)
If I manually stop the browser refreshing, it performs the next click but then again the browser keeps on loading.
I have already included
this.driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
I have tried sendKeys(Keys.ESCAPE) too. Nothing seem to work

How do I enable popups in a new Firefox profile using selenium webdriver (Java)

The application I am testing requires pop-up to be enabled. When a launch a new Firefox profile I get the browser message
Firefox prevented this site from opening a pop-up window
with a button on the right called Options. I can manually click the Options button and select to Allow popups from ....
Question is how can I use profile.setPreference to set to allow popups from my website and also not show this Firefox message?
You can save your current Firefox prifile with allowed popups and load it from file like in this case: https://stackoverflow.com/a/6830109/1165331
save you current working profile with popups via browser and loat it.