(注意:由于某种原因,我无法在原始博客上提出这个问题)。
如本博客所述:http://blogs.msdn.com/b/gautamg/archive/2010/01/05/2-hello-world-extension-for-coded-ui-test.aspx
更具体地说,这部分让我感到悲伤:
构建和构建部署扩展
生成二进制文件并将其部署到 "%CommonProgramFiles%\Microsoft Shared\VSTT\10.0\UITestExtensionPackages"
目录。要进行部署,请使用以下命令:
md "%CommonProgramFiles%\Microsoft Shared\VSTT\10.0\UITestExtensionPackages"
-
对于 32 位 - xcopy /y "%~dp0\bin\Debug\UITestHelloWorldPackage.*" "%CommonProgramFiles%\Microsoft Shared\VSTT\10.0\UITestExtensionPackages\*. *"
-
对于 64 位 - xcopy /y "%~dp0\bin\Debug\UITestHelloWorldPackage.*" "%CommonProgramFiles(x86)%\Microsoft Shared\VSTT\10.0\UITestExtensionPackages\*。 *"
注意 – 上面假设您正在构建 VS 中默认的调试版本。此外,如果您使用的是 Windows Vista 或更高版本,则需要使用管理权限从 CMD 窗口执行上述步骤才能访问 "%CommonProgramFiles%"
。
对于部署,如果由于某种原因作者不想复制到预定义目录,另一种选择是在注册表中添加以下内容 -
创建 “HKLM\Software\Microsoft\VisualStudio\10.0\TeamTest\UITest\UITestExtensionPackages”键。
在此之下,使用您的扩展名称创建一个密钥,例如此处的“HelloWorldPackage”。将此键的默认值设置为扩展的完整路径。例如,“C:\MyDir\MyExtension.dll”
。
我的问题:我更喜欢注册表方法,但它不起作用。将文件直接复制到 "%CommonProgramFiles(x86)%\Microsoft Shared\VSTT\10.0\UITestExtensionPackages\"
确实有效。我可以在调试输出中看到“Hello world”消息,如验证扩展部分中所述:转到“%temp%\UITestLogs\CodedUITestBuilder\LastRun”
目录并查看 UITestLog.html
。
我更喜欢注册表方法,该方法不起作用,并且正如我在开头提到的,我无法在原始博客上发布此问题。
如果您有机会在同一领域工作并取得成功,请分享您的智慧。我不知道如何调试这个注册表问题,因为我没有看到任何输出。据我所知,使用注册表方法的说明可能不正确,或者根本不存在,就像将文件名 schneller.txt
放在 C:\
不会使 Windows 操作系统启动速度加快 4 秒(不幸的是),如果您被告知不是这样,那么祝您顺利排除故障!
欢迎回答、评论、提问。
(Note: I am unable to ask this question on the original blog for some reason).
As described in this blog: http://blogs.msdn.com/b/gautamg/archive/2010/01/05/2-hello-world-extension-for-coded-ui-test.aspx
More specifically, this section gives me grief:
Build & Deploy the extension
Build and deploy the binaries to "%CommonProgramFiles%\Microsoft Shared\VSTT\10.0\UITestExtensionPackages"
directory. To deploy, you use following commands:
md "%CommonProgramFiles%\Microsoft Shared\VSTT\10.0\UITestExtensionPackages"
-
For 32 bit - xcopy /y "%~dp0\bin\Debug\UITestHelloWorldPackage.*" "%CommonProgramFiles%\Microsoft Shared\VSTT\10.0\UITestExtensionPackages\*.*"
-
For 64 bit - xcopy /y "%~dp0\bin\Debug\UITestHelloWorldPackage.*" "%CommonProgramFiles(x86)%\Microsoft Shared\VSTT\10.0\UITestExtensionPackages\*.*"
Note – The above assumes you are building Debug build which is default in VS. Also, if you are using Windows Vista or higher, you will need to do above steps from CMD window with administrative privilege to access "%CommonProgramFiles%"
.
For deploying, another alternative if for some reason the author does not want to copy to the predefined directory is to add following in registry –
Create “HKLM\Software\Microsoft\VisualStudio\10.0\TeamTest\UITest\UITestExtensionPackages”
key.
Under this, create a key with your extension name like “HelloWorldPackage”
here. Set the default value of this key to full path of the extension. For example, “C:\MyDir\MyExtension.dll”
.
My problem: I prefer the registry method, but it does not work. Copying the files directly over to "%CommonProgramFiles(x86)%\Microsoft Shared\VSTT\10.0\UITestExtensionPackages\"
does work. I am able to see the "Hello world" message in the debugging output as mentioned in the Verify Extension section: Go to "%temp%\UITestLogs\CodedUITestBuilder\LastRun"
directory and view UITestLog.html
.
I prefer the registry method, which is not working, and, as I mentioned at the beginning, I am unable to post this question on the original blog.
If you have had a chance to play in the same area and have had success, please share your wisdom. I am not sure how to debug this registry problem, as I see no output. For all I know, the instructions for using the registry method could be incorrect, or not exist at all in the same way as placing a file name schneller.txt
in C:\
does not make the Windows OS boot 4 seconds faster (unfortunately), and if you have been told otherwise, then good luck troubleshooting that!
Answers, comments, questions are welcome.
发布评论
评论(1)
如果我对其他程序集没有任何依赖性,则注册表方式对我来说工作正常。
您面临的问题很可能是由于无法找到扩展的依赖项造成的。
CodedUITestBuilder 不会查看您提到的位置处的依赖程序集。您可能需要修改配置文件来解析依赖程序集。
最简单(不是很好)的方法是将您的内容复制到指定的文件夹。
Registry way is working fine for me IF I don't have any dependencies on other assemblies.
The problem you face may most likely due to inability to locate the dependencies for your extension.
CodedUITestBuilder does not look at the dependent assemblies at the location you mention. You may need to tinker the configuration files to resolve your dependent assemblies.
Easiest (not great) approach is to copy your stuff to the designated folder.