New issue
Advanced search Search tips

Issue 904207 link

Starred by 2 users

Issue metadata

Status: Unconfirmed
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 705916



Sign in to add a comment

CSS selector in UI mode and headless mode works differently!

Reported by davidshe...@gmail.com, Nov 11

Issue description

Chrome Version       : Version 70.0.3538.102 (Official Build) (64-bit)
URLs (if applicable) : N/A
Other browsers tested: N/A
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari:
    Firefox:
       Edge:

What steps will reproduce the problem?
(1) Execute the e2e test from the https://github.com/davidshen84/davidshen84.github.io project using the `protractor.conf.js` configuration file.
(2) Execute the e2e test from the https://github.com/davidshen84/davidshen84.github.io project using the `protractor.conf.ci.js` configuration file.
(3) Observe the results

What is the expected result?

Both tests should pass.

What happens instead?

The test in the 2nd run fails.

Please provide any additional information below. Attach a screenshot if
possible.

It seems the css selector in UI mode and Headless mode works differently. When running the test with UI, the css selector works as expected. But when running the test in headless mode, the css selector can select multiple elements with the given expression.
 
Labels: Needs-Triage-M70
I am encountering an issue when running tests as well in headless mode.
Chrome version - Version 70.0.3538.110 (Official Build) (64-bit)
Chrome driver- ChromeDriver 2.44.609545 
Selenium Webdriver - 3.14.0

I have a test that interacts with a navigation bar.
This test runs successfully to completion in UI mode and I can see the expected interactions occurring as the test progresses.
This same test fails to find the css selector for the nav bar in headless mode.

This is the error that i get from selenium in headless that i do not get in UI mode.
"Unable to find visible css"

I open chrome and navigate to the page and cam find the css I am looking for in devtools dom view.


 
In addition to comment above:

I modified the test framework to not ignore hidden/non-visible elements and get this error instead.

Error Message: element not interactable
  (Session info: headless chrome=70.0.3538.110)
  (Driver info: chromedriver=2.44.609545 (c2f88692e98ce7233d2df7c724465ecacfe74df5),platform=Mac OS X 10.13.6 x86_64)


I uncovered the reason for my issue.  
Headless was defaulting to width=800, height=600
UI mode was defaulting to width=1200, height=970

The page is reactive so the smaller viewport default in headless resulted in a mobile presentation where the element I was looking for was not visible but once I forced headless to a desktop viewport size, the test completed successfully.

Yes, add "window-size=1920,1080" into the browser options solved my problem. Thansk.

Sign in to add a comment