我们有一个非常大的自动化套件,需要花费大量的时间来运行。这些是Windows应用程序的UI测试,我们使用LeanFT& NUnit的。它不是网络我们还没有任何类型的并行/网格解决方案启动和运行。
整个套件有大约110个测试,所有测试都在一个代理上运行。大约80%的方式,测试运行随机断开&我们看到了这个错误
@Override
public void onBindViewHolder(SingleViewHolder holder, int position) {
final Single single = singleList.get(position);
if (single.getImg() != 0 ) {
String resourceName = String.valueOf(single.getImg());
int checkExistence = mContext.getResources().getIdentifier(resourceName , "drawable", mContext.getPackageName());
// Most secure checking for resource availability
if (checkExistence != 0 ) {
try {
holder.img.setImageResource(single.getImg());
} catch (Exception e) {
e.printStackTrace();
}
}
}
holder.title.setText(single.getTitle());
}
在测试套件中间出现运行时错误的原因是什么?在使用这个框架扩展测试自动化时,有没有其他人经历过类似的事情?谢谢!
这是另一个堆栈跟踪,来自最初的断开连接。这可以在hpe.leanft.runtime日志文件
中找到Error Details
Runtime Error
HP.LFT.SDK.GeneralLeanFtException: Channel was disconnected
at HP.LFT.SDK.Core.ClassModel.TestObjectExecuterBase.HandleReplayError(Int32 errorCode, IDictionary`2 data)
at HP.LFT.SDK.Core.Communication.CommunicationClient.HandleError(Action`2 onError, Int32 status, IDictionary`2 data)
at HP.LFT.SDK.Core.Communication.CommunicationClient.Send(String messageType, IDictionary`2 data, Action`2 onError)
at HP.LFT.SDK.Core.ClassModel.TestObjectExecuter.ExecuteMethod[TResult](String methodName, Object[] arguments)
at HP.LFT.SDK.Core.ClassModel.TestObjectBase.ExecuteMethod[TResult](String methodName, Object[] arguments)
at HP.LFT.SDK.OperationExecutionWrapper.ExecuteWithEventsInternally[T](ITestObject testObject, Object additionalInfo, Func`1 innerAction, MethodBase methodInfo, Boolean reportOnlyOnError, Object[] arguments)
at HP.LFT.SDK.OperationExecutionWrapper.ExecuteWithEvents[TR](Func`1 innerAction, Func`1 originalMethod, Boolean reportOnlyOnError, ITestObject testObject, Object additionalInfo)
at HP.LFT.SDK.UiObjectBase.get_IsVisible()
此外,在我上面的日志
之前,我看到了数百个[2018-07-11 12:50:47.189] [INFO] ChannelHelper - Channel close. ChannelId:0
[2018-07-11 12:50:47.190] [INFO] ChannelHelper - _cleanPendingRequests: Called
[2018-07-11 12:50:47.195] [INFO] WSCommunicationChannel - _onClose : Disconnected from ws://localhost:53500
[2018-07-11 12:50:47.195] [INFO] LightWeight.Dispatcher - onDisconnect: disconnected from { target: 'LftRuntime' }
[2018-07-11 12:50:47.197] [INFO] LightWeight.Dispatcher - disconnected from NativeRuntime!
[2018-07-11 12:50:47.197] [INFO] LightWeight.Dispatcher - NativeRuntime is down!, exiting...
[2018-07-11 12:50:47.197] [INFO] LicenseManager - onBeforeClose: releasing license
[2018-07-11 12:50:47.198] [WARN] Engine.ChannelManager - Exception when sending to client Error TypeError: Cannot read property 'send' of null
at Object.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_communication_channel.js:149:35)
at ChannelManagerBase.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\channels-base.js:63:32)
at Dispatcher.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:175:40)
at LftLicenseManager.onBeforeClose (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\license_manager.js:151:32)
at C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\dispatcher-base.js:44:20
at Array.map (native)
at DispatcherBase.notifyDispatcherEvent (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\dispatcher-base.js:43:40)
at Dispatcher._closeProcess (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:257:37)
at Dispatcher.onLftRuntimeDown (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:249:14)
at Dispatcher.onDisconnect (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:126:18)
TypeError: Cannot read property 'send' of null
at Object.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_communication_channel.js:149:35)
at ChannelManagerBase.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\channels-base.js:63:32)
at Dispatcher.send (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:175:40)
at LftLicenseManager.onBeforeClose (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\license_manager.js:151:32)
at C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\dispatcher-base.js:44:20
at Array.map (native)
at DispatcherBase.notifyDispatcherEvent (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\lightweight-engine-common\lib\dispatcher-base.js:43:40)
at Dispatcher._closeProcess (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:257:37)
at Dispatcher.onLftRuntimeDown (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:249:14)
at Dispatcher.onDisconnect (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\lib\dispatcher.js:126:18)
[2018-07-11 12:50:47.200] [INFO] LicenseManager - got disconnected from LftRuntime
[2018-07-11 12:50:47.200] [INFO] LicenseManager - marking license as invalid
[2018-07-11 12:50:47.201] [INFO] SessionManager - onClientDisconnected: eventInfo: { client: { target: 'LftRuntime' }, additionalInfo: {} }
[2018-07-11 12:50:47.203] [INFO] SessionManager - going to send session closes event
[2018-07-11 12:50:47.210] [INFO] ChannelHelper - Channel close. ChannelId:0
[2018-07-11 12:50:47.210] [INFO] ChannelHelper - _cleanPendingRequests: Called
[2018-07-11 12:50:47.212] [INFO] ChannelHelper - _cleanPendingRequests: Still have pending requests going to notify an error
[2018-07-11 12:50:47.213] [WARN] PackagesManager.ChannelManager - Error when sending to client Error { Error: Channel was disconnected
at Object.<anonymous> (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:191:37)
at Array.forEach (native)
at Object._cleanPendingRequests (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:185:29)
at Object._onClose (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:212:14)
at emitTwo (events.js:106:13)
at WebSocket.emit (events.js:191:7)
at WebSocket.cleanupWebsocketResources (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\ws\lib\WebSocket.js:950:8)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1277:8) status: -602 }
Error: Channel was disconnected
at Object.<anonymous> (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:191:37)
at Array.forEach (native)
at Object._cleanPendingRequests (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:185:29)
at Object._onClose (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\leanft.common\lib\websocket_channel_helper.js:212:14)
at emitTwo (events.js:106:13)
at WebSocket.emit (events.js:191:7)
at WebSocket.cleanupWebsocketResources (C:\Program Files (x86)\HPE\LeanFT\LWE\lightweight-engine\node_modules\ws\lib\WebSocket.js:950:8)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1277:8)
[2018-07-11 12:50:47.213] [INFO] WSCommunicationChannel - _onClose : Disconnected from ws://localhost:53500
[2018-07-11 12:50:47.214] [INFO] Dispatcher - onDisconnect: disconnected from { target: 'LftRuntime' }
[2018-07-11 12:50:47.216] [WARN] Engine.ChannelManager - send: received error from: PackageManager_1