简体   繁体   中英

What does mean by “running selenium tests are in headless mode ” in jenkins

谁能解释在jenkins中以无头模式运行硒测试的情况?

As per comment it's a way of running tests in a browser that doesn't have a GUI attached to it

What is a headless browser? (Quoted from ToolsQA )

Headless browser is a term used to define browser simulation programs which do not have a GUI. These programs behave just like a browser but don't show any GUI. Famous ones are HtmlUnit and the NodeJs headless browsers. There are a good number of more browsers too.

What is the use of Headless browsers?

Headless browsers are typically used in following situations

  1. You have a central build tool which does not have any browser installed on it. So to do the basic level of sanity tests after every build you may use the headless browser to run your tests.

  2. You want to write a crawler program that goes through different pages and collects data, headless browser will be your choice. Because you really don't care about opening a browser. All you need is to access the webpages.

  3. You would like to simulate multiple browser versions on the same machine. In that case you would want to use a headless browser, because most of them support simulation of different versions of browsers. We will come to this point soon.

Things to pay attention to before using headless browser

Headless browsers are simulation programs, they are not your real browsers. Most of these headless browsers have evolved enough to simulate, to a pretty close approximation, like a real browser. Still you would not want to run all your tests in a headless browser. JavaScript is one area where you would want to be really careful before using a Headless browser. JavaScript are implemented differently by different browsers. Although JavaScript is a standard but each browser has its own little differences in the way that they have implemented JavaScript. This is also true in case of headless browsers also. For example HtmlUnit headless browser uses the Rihno JavaScript engine which not being used by any other browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM