【问题标题】:How to obtain the Hardware information of the computer using Test Complete如何使用 Test Complete 获取计算机的硬件信息
【发布时间】:2015-04-22 14:30:44
【问题描述】:

现在我正在进行性能测试,我遇到了一种情况,我需要获取执行测试的计算机的硬件信息。有什么方法可以使用 JScript 获取硬件信息。

感谢和问候,

大师...

【问题讨论】:

  • 究竟是哪些信息? CPU 名称、内存大小、监视器数量等?请具体。
  • 谢谢 Helen 的回复.....我正在尝试获取有关计算机上安装的 RAM 和处理器的信息。

标签: testing automated-tests performance-testing testcomplete


【解决方案1】:

** 我得到了答案.....发布这个可能对其他人有用......**

function RAM_Information()
{
var SystemAttributes = GetObject("winmgmts:");
var RAMSize = 0;
var MemoryPackets = SystemAttributes.ExecQuery("SELECT Capacity FROM  Win32_PhysicalMemory");

var enumItems = new Enumerator(MemoryPackets);
for ( ; !enumItems.atEnd(); enumItems.moveNext())
{
RAMSize += aqConvert.StrToFloat(enumItems.item().Capacity);
}

Log.Message("Total physical memory: " + VarToStr(RAMSize*0.000000001) + " GB");
return RAMSize*0.000000001;
}



function ProcessorInformation()
{
return Sys.CPU;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-28
    • 1970-01-01
    • 2014-12-30
    • 1970-01-01
    • 1970-01-01
    • 2013-04-14
    相关资源
    最近更新 更多