Selenium 和 Node.js

huangapple 未分类评论49阅读模式
英文:

Selenium and nodeJs

问题

我有一个可导入的JAR文件,可以捕获网页的性能。用法是,如果您有现有的Selenium自动化代码,只需调用将调用该JAR并记录性能的方法。

现在我有一个要求,需要以JSON格式从Chrome性能Lighthouse获取审核数据,这只能在客户端机器上安装NPM才能完成,然后我必须通过npm安装performancelignthouse,如下所示:

npm install -g lighthouse
lighthouse --output=json --output-path=./report.json https://airhorner.com/

这样我就可以获得JSON数据。

所以我的问题是,是否有办法通过Chromedriver运行第二行代码,而无需在客户端机器上安装node?

提前感谢……

英文:

I have an importable jar that captures performance of Web page. Use case is like, if you have an existing selenium automation code you can simply call the method that will invoke the jar and record performance.

Now I have a requirement to get the audit data from Chrome Performance Lighthouse in a json format that can only be done installing NPM on client machine, then I have to install performancelignthouse via npm like:

npm install -g lighthouse
lighthouse --output=json --output-path=./report.json https://airhorner.com/ 

This way I can get the JSON data.

So here my question , is there any way to run the second line of code via Chromedriver without installing node on client machine?

Thanks in advance......

huangapple
  • 本文由 发表于 2020年5月29日 05:34:14
  • 转载请务必保留本文链接:https://java.coder-hub.com/62074915.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定