VMWare Workstation 7 自动化命令
来源:互联网 发布:编程思想有哪些 编辑:程序博客网 时间:2024/06/05 11:58
VMWare Workstation在自动化测试可以得到很好的应用,原因在于其拥有强大的快照功能,能通过命令行方式方便的执行类似于Ghost的操作,这在准备干净的测试环境时用途非常明显。去年VMWare推出的最新Workstation7为Windows7提供了很好的操作平台,为Windows7的稳定运行提供了保障。
1. 命令行启动VMWare Workstation:
C:/Program Files/VMware/VMware Workstation/vmware.exe [-B] [-n] [-x] [-X]
[-t] [-q] [-s <variablename>=<value>] [-v] [<path_to_virtual_machine>/<virtual_machine_name>.vmx]
Option
Description
-n
Opens a new Workstation window.
-B
(Windows hosts only) Opens a new Workstation window but hides the sidebar and toolbars. Only the tabs of open virtual machines are shown. Using this option has the same effect as clicking the Workstation icon in the upperleft corner of the Workstation window and choosing Hide Controls from the menu that appears.
-t
Opens a virtual machine or team in a new tab in the existing Workstation window.
-x
Powers on the virtual machine when Workstation starts. This is equivalent to clicking the Power On button in the Workstation toolbar
-X
Powers on the virtual machine and switches the Workstation window to full screen mode.
-m
Starts the program in quick switch mode.
-q
Closes the virtual machine’s tab when the virtual machine powers off. If no other virtual machine is open, it also exits Workstation. This option is useful when the guest operating system can power off the virtual machine
-s
Sets the specified variable to the specified value. Any variable names and values that are valid in the configuration file can be specified on the command line with the -s switch
-v
Displays the product name, version, and build number
<path_to_virtual_machine>
Launches a virtual machine by using the specified virtual machine or team configuration file (.vmx or .vmtm file).
2. vmrun命令行工具:
对于自动化测试有如下实用命令行(-T代表目标类型,后更参数ws代表Workstation):
l Power Commands:开启、停止、重启、挂起虚拟机
vmrun -T ws start|stop|reset|suspend “path_of_wmx_file”
start,有两个参数gui|nogui,前者是默认参数,参数加在末尾
stop/reset/suspend有两个参数hard|soft,hard代表执行命令前不运行wmtools文件夹中对应的批处理文件,soft代表执行命令前运行批处理文件,参数加在末尾
l Snapshot Commands:创建、删除、还原快照
vmrun -T ws snapshot|deleteSnapshot|revertToSnapshot “path_of_wmx_file” “snap_shot_name”
Snapshot还有一个命令是listSnapshots,列出所有快照名
l Record and Replay Commands:
vmrun -T ws -gu <user> -gp <pass> beginRecording “path_of_wmx_file” “session_name”
vmrun -T ws -gu <user> -gp <pass> endRecording “path_of_wmx_file”
上述命令配对使用。
l Guest Operating System Commands:
此类型命令较多,摘取部分较有价值的列举如下:runProgramInGuest | runScriptInGuest | listProcessesInGuest | killProcessInGuest | fileExistsInGuest | deleteFileInGuest | renameFileInGuest | createDirectoryInGuest | deleteDirectoryInGuest | listDirectoryInGuest | copyFileFromHostToGuest | copyFileFromGuestToHost | captureScreen
更多命令请参考如下文档:
《Workstation User’s Manual》for VMWare Workstation 7
《Using vmrun to Control Virtual Machines》
- VMWare Workstation 7 自动化命令
- VMWare Workstation 7 自动化命令
- VMWare Workstation 7 自动化命令
- VMware Workstation 7 for linux
- VMWare Workstation 7 初体验
- vmware workstation
- VMware workstation
- VMware Workstation
- vmware workstation
- VMware Workstation
- VMWare Workstation 7出炉 支持Win7 Aero
- vmware workstation 7安装MAC操作系统
- VMware Workstation 7 安装 ESX 4.1
- VMware Workstation下安装CentOS 7系统
- VMware Workstation虚拟机 12.5.7安装
- VMware Workstation虚拟机12.5.7安装windows_server_2008_r2_standard_x64
- VMware Workstation 12.5.7 PRO 安装 CentOS7
- VMware workstation批量创建虚拟机和自动化安装操作系统(一)
- 相册图片防盗链破解(如:在外部也能显示qq、163或百度空间图片)
- ASP.NET URL Rewrite. URL重写
- 全球域名实名率仅23%
- 封装Ftp API函数,实现上传,下载文件,创建目录
- 判断是否有同名的文件存在
- VMWare Workstation 7 自动化命令
- 2010-03-16 记
- POJ 1042 Gone Fishing(贪心)
- 于心未死
- test
- 差异备份、增量备份的区别
- 在Qt 4中如何固定窗口的大小
- 宝姿教父的隐秘时尚帝国
- VB 将长路径转为短路径 & 获取剪粘板中的文件的列表