NoSmoke icon indicating copy to clipboard operation
NoSmoke copied to clipboard

common/logger.js platform不为ios或android时,cmd会为空字符串,导致报错

Open zxsky316 opened this issue 6 years ago • 3 comments

想用nosmoke做web-pc的遍历测试,发现会报错,最后定位到了common/logger.js中, 报错信息如下 TypeError: "file" argument must be a non-empty string at normalizeSpawnArguments (child_process.js:384:11) at exports.spawn (child_process.js:497:38) at Object.exports.execFile (child_process.js:213:15) at exports.exec (child_process.js:143:18) at Logger.filterDeviceLogs (/Users/zhengxu/Documents/software/npm/lib/node_modules/nosmoke/lib/common/logger.js:62:16) at EventEmitter.root.eventEmmiter.addListener (/Users/zhengxu/Documents/software/npm/lib/node_modules/nosmoke/lib/crawler/index.js:56:10) at emitOne (events.js:116:13) at EventEmitter.emit (events.js:211:7) at WDClient.onSessionCreated (/Users/zhengxu/Documents/software/npm/lib/node_modules/nosmoke/lib/wd-client.js:54:21) at that.send (/Users/zhengxu/Documents/software/npm/lib/node_modules/nosmoke/lib/wd-client.js:45:14) -----> Crawling Finished: <----- TypeError: "file" argument must be a non-empty string

注释掉index.js中的 logger.filterDeviceLogs(root.config); 可以正常运行nosmoke命令,配置文件中时对所有的 a标签进行点击操作,但是实际运行能打开页面,但是未发生点击操作,能帮忙个看下是什么问题吗?

zxsky316 avatar May 09 '19 11:05 zxsky316

This is the translated issue:


When common/logger.js platform is not ios or android, cmd will be an empty string, resulting in an error.

I want to use nosmoke to do the web-pc traversal test. I found that I will report an error and finally locate it in common/logger.js. The error message is as follows TypeError: "file" argument must be a non-empty string     At normalizeSpawnArguments (child_process.js:384:11)     At exports.spawn (child_process.js:497:38)     At Object.exports.execFile (child_process.js:213:15)     At exports.exec (child_process.js:143:18)     At Logger.filterDeviceLogs (/Users/zhengxu/Documents/software/npm/lib/node_modules/nosmoke/lib/common/logger.js:62:16)     At EventEmitter.root.eventEmmiter.addListener (/Users/zhengxu/Documents/software/npm/lib/node_modules/nosmoke/lib/crawler/index.js:56:10)     At emitOne (events.js:116:13)     At EventEmitter.emit (events.js:211:7)     At WDClient.onSessionCreated (/Users/zhengxu/Documents/software/npm/lib/node_modules/nosmoke/lib/wd-client.js:54:21)     At that.send (/Users/zhengxu/Documents/software/npm/lib/node_modules/nosmoke/lib/wd-client.js:45:14) -----> Crawling Finished: <-----  TypeError: "file" argument must be a non-empty string

Comment out the logger.filterDeviceLogs(root.config) in index.js; The nosmoke command can be run normally. When all the a tags are clicked in the configuration file, the actual operation can open the page, but no click operation occurs. Can you help me to see what the problem is?

macaca-bot avatar May 09 '19 11:05 macaca-bot

logger 的问题不影响pc-web 下的爬行实现, 应该是别的问题. 此处exception会修复

SamuelZhaoY avatar Jan 04 '20 03:01 SamuelZhaoY

This is the translated issue comment: @SamuelZhaoY


Logger problem does not affect the crawl achieved in pc-web, it should be another question. Here exception will be fixed

macaca-bot avatar Jan 04 '20 03:01 macaca-bot