简体   繁体   English

在詹金斯中,“运行硒测试处于无头模式”是什么意思

[英]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 根据评论,这是在没有附加GUI的浏览器中运行测试的方法

What is a headless browser? 什么是无头浏览器? (Quoted from ToolsQA ) (引自ToolsQA

Headless browser is a term used to define browser simulation programs which do not have a GUI. 无头浏览器是一个术语,用于定义没有GUI的浏览器模拟程序。 These programs behave just like a browser but don't show any GUI. 这些程序的行为就像浏览器一样,但是不显示任何GUI。 Famous ones are HtmlUnit and the NodeJs headless browsers. 著名的是HtmlUnit和NodeJs无头浏览器。 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. 在使用Headless浏览器之前,JavaScript是您需要非常小心的地方。 JavaScript are implemented differently by different browsers. 不同的浏览器对JavaScript的实现方式有所不同。 Although JavaScript is a standard but each browser has its own little differences in the way that they have implemented JavaScript. 尽管JavaScript是一种标准,但是每种浏览器在实现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. 例如,HtmlUnit无头浏览器使用Rihno JavaScript引擎,而其他任何浏览器都不会使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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