google-chrome-headless

Cannot locate elements using headless mode Selenium

泄露秘密 提交于 2021-02-05 09:29:38
问题 I cannot locate elements using headless mode because of this restriction "All users will have to use google Chrome when accessing our sites." This restriction was added by our admins so users could use only Google chrome. My code is @Test(priority = 1) public void setupApplication() throws IOException { /* * open browser (GoogleChrome) and enter user credentials */ ChromeOptions options = new ChromeOptions(); options.addArguments("--window-size=1920,1080"); options.addArguments("--disable-gpu

Fullscreen in Headless Chrome using Selenium [duplicate]

扶醉桌前 提交于 2021-02-05 09:26:18
问题 This question already has answers here : How to set window-size to fullscreen for headless-chrome using chrome options? (3 answers) Closed 3 months ago . I have a number of tests in an E2E suite where a video element is fullscreened and the fullscreen status is verified. However, when running the suite headlessly, these tests fail. Screenshots of the page show the video is simply not in fullscreen, even after the fullscreen button is clicked. Is there a way to achieve fullscreen functionality

How to set window-size to fullscreen for headless-chrome using chrome options?

血红的双手。 提交于 2021-02-04 14:58:36
问题 When executing UI tests, I get an error that selenium doesn't support automatic window resizing for chromedriver, which results in tests failing. Is there a way to set this using chrome-options for headless-chrome ? I have tried the following, ChromeOptions options = new ChromeOptions(); options.addArguments("--start-maximized"); Also, replacing "--start-maximized" with "--start-fullscreen" and "--kiosk" . But none of the above worked for me, the only option that works for me is "--window

How to set window-size to fullscreen for headless-chrome using chrome options?

Deadly 提交于 2021-02-04 14:58:09
问题 When executing UI tests, I get an error that selenium doesn't support automatic window resizing for chromedriver, which results in tests failing. Is there a way to set this using chrome-options for headless-chrome ? I have tried the following, ChromeOptions options = new ChromeOptions(); options.addArguments("--start-maximized"); Also, replacing "--start-maximized" with "--start-fullscreen" and "--kiosk" . But none of the above worked for me, the only option that works for me is "--window

How to preserve @page margin but with a sidebar

允我心安 提交于 2021-01-29 10:35:19
问题 I've been trying to generate a dynamic invoice using Handlebars and Puppeteer. Now the problem is that I need to display a 'sidebar' so to speak in my invoice template. However, I also need @page margin so that overflowing content gets wrapped to a new page with enough margin. See image below for clarification: I set up a github repo with example code you can check out here (instructions to run project in read.me). How can I preserve the margin added with @page , but also have a sidebar that

unknown error: failed to wait for extension background page to load: chrome-extension error loading an extension to Chrome Headless using Selenium

十年热恋 提交于 2021-01-29 10:31:12
问题 I try to run chromedriver via selenium in headless mode. IMPORTANT The code runs perfectly fine if I eliminate the following code lines (but is not headless): chrome_options.add_argument('--headless') chrome_options.add_argument('--no-sandbox') chrome_options.add_argument('--disable-dev-shm-usage') This is the error I get when I try to implement the headless argument: Traceback (most recent call last): File "camel_amazon_scraper.py", line 83, in <module> executable_path=executable_path) File

TestCafe & chrome:headless : how to force the browser language (locale)

谁说我不能喝 提交于 2021-01-29 03:13:32
问题 I have write a few browser test who run with TestCafe, chrome:headless. The test are launched by commandline, from a server that I don't want to change the default language. My website is multi-language. I want to be change the language of the test, without having to impact the language of the server/computer each time. How can I do that? I launch the tests with this command line: npx testcafe chrome:headless src/scenarios/**/*.test.ts 回答1: It all depends on your "multi-language"

RSpec + headless Chrome for front-end integration test

末鹿安然 提交于 2021-01-28 11:10:11
问题 I'm trying to test a part of my Rails 5.1 app that makes use of Vue.js. The issue I'm encountering is that, for example when generating a list, the Vue code looks like: <div v-for="(amenity, idx) in amenities"> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input" v-bind:id="amenity.text" v-model="checkedAmenities[idx]" :value="amenity.id"> <label class="custom-control-label" v-bind="{ 'for': amenity.text }" >{{ amenity.text }}</label> </div> </div>

Headless chrome: chrome not reachable

懵懂的女人 提交于 2021-01-27 21:10:24
问题 I am using Chrome headless to run the protractor test. It runs for a while but after that i get the following error. [15:36:30] E/launcher - chrome not reachable (Session info: headless chrome=59.0.3071.115) (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 5 milliseconds Build info: version: '3.4.0', revision: 'unknown', time:

Run testcafe headless when passing custom args to Chrome binary via testcafe-browser-tools

强颜欢笑 提交于 2021-01-27 12:10:25
问题 Running testcafe inside a Vagrant VM, which is mostly working. However, Chrome doesn't start properly in this environment with hardware acceleration enabled, so I have to start it with the command line flag --disable-gpu . I'm leveraging the 'testcafe-browser-tools' package to accomplish this, by overriding the default browser command via the Runner class in the TestCafe API. This all works fine for the case of running TestCafe with it opening a browser window, but I've not been able to