开发者

Selenium - When running builds via the grid, how do you get the console output?

开发者 https://www.devze.com 2023-04-05 02:25 出处:网络
We\'ve been running Selenium tests via local RC for a few years, and are starting to migrate to the grid. We have been redirecting the console output of the server to our own test logs. It is quite us

We've been running Selenium tests via local RC for a few years, and are starting to migrate to the grid. We have been redirecting the console output of the server to our own test logs. It is quite useful for debugging. The console output looks suspiciously like Log4J - so it should be reconfigurable.

10:31:51.894 INFO - Command request: open[http://websiteundertest/IsSiteUpUp.aspx, ] on session 46c211b412474429957dbf6bebccd64d
10:31:55.323 INFO - Got result: OK on session 46c211b412474429957dbf6bebccd64d
10:31:56.330 INFO - Command request: isElementPresent[xpath=//h2, ] on session 46c211b412474429957dbf6bebccd64d
10:31:56.343 INFO - Got result: OK,true on session 46c211b412474429957dbf6bebccd开发者_C百科64d

When re run via the hub, the console output appears only on the remote RC. The simple console redirection won't work. In scope of this question, we need to capture the remote console output someplace where the computer executing the test can get to it. We run our tests from a number of build agents via C#. We are trying grid 1 and 2. We intend to go directly to Grid 2.x.


What he meant was that this:

java -jar selenium-server-standalone-2.15.0.jar -role webdriver -hub http://127.0.0.1:4444/grid/register > mylog.txt

does not work. It will create a new file but it will be empty. I suggest using -log mylog.txt argument when starting node or server to store log files


In the latest version of Grid, you can redirect the output when you start each of your client nodes: java -jar selenium-server-standalone-2.15.0.jar -role webdriver -hub http://127.0.0.1:4444/grid/register > mylog.txt

This is a Windows example. You can also centralize log files on some remote server by referencing a \\serverName\mylog.txt in your redirect.

When you say:

The simple console redirection won't work...

I'm not sure I understand.

0

精彩评论

暂无评论...
验证码 换一张
取 消