现在我正在一个自动化项目中工作。在那我有一个测试用例,测试用例是我必须确保一个窗口媒体播放器。我尝试了很多,但我不能。
帮帮我,我在项目截止日期。
提前感谢...
final String wmp = "C:\Program Files\Windows Media Player\wmplayer.exe";
运行 WMP
Runtime.exec(wmp);
或确保该路径存在...
System.out.println(new File(wmp).exists());
当然,在Windows XP上也是如此,您可能需要调整x64 Windows或Windows Vista+的路径。这可能对以下原因有所帮助:
final String os = System.getProperty("os.name") + " " + System.getProperty("os.arch");
System.out.println(os);