Java 将 Selenium 与 HP ALM 集成
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21036333/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Integrating Selenium with HP ALM
提问by Ave
We have a requirement to understand if Selenium could be integrated with HP ALM. The requirement is to execute the Selenium scripts from ALM and to update back the results in ALM. From the research done till now we have got to know that it is possible by using VAPI-XP script, XTools.Run and Ant.
我们需要了解 Selenium 是否可以与 HP ALM 集成。要求是从 ALM 执行 Selenium 脚本并更新回 ALM 中的结果。从研究到现在,我们已经知道使用 VAPI-XP 脚本、XTools.Run 和 Ant 是可能的。
We are looking for a solution for integrating Selenium with HP ALM using any Java Framework like JUnit or TestNG.
我们正在寻找使用任何 Java 框架(如 JUnit 或 TestNG)将 Selenium 与 HP ALM 集成的解决方案。
If anyone has any source of information regarding this, please let us know.
如果有人有任何关于此的信息来源,请告诉我们。
We have got one similar discussion at how to integrate selenium with QC?Please help
关于如何将 selenium 与 QC 集成,我们有过类似的讨论?请帮忙
But the problem is when we follow the procedure told in the discussion we always get Pass result. We would like to update the status in HP ALM based on the exceptions and errors occurred during the execution of Selenium scripts. Any help would be much appreciated.
但问题是,当我们按照讨论中的程序进行操作时,我们总是会得到 Pass 结果。我们想根据 Selenium 脚本执行期间发生的异常和错误更新 HP ALM 中的状态。任何帮助将非常感激。
Thanks in advance.
提前致谢。
回答by TechDog
Solution:1Please look in to below website. It has got all the stuffs related to updating test results to ALM Testset http://automationtestingutilities.blogspot.in/2013/12/IntegrationWithQCorALMusingALMServiceWrapperPart2.html
解决方案:1请查看以下网站。它已经获得了与将测试结果更新到 ALM 测试集相关的所有内容http://automationtestingutilities.blogspot.in/2013/12/IntegrationWithQCorALMusingALMServiceWrapperPart2.html
Solution:2
解决方案:2
Register HP ALM Client via ALM>>Help>>Addins page.
Download Jacob dll(Both 64,32 bit), jacob jar
Add it to your project path.(DLL--> Just copypaste to project path), Jacob.jar-->Add it to build path.
Create a class
Below example code gives you some idea about how to use COM API in java+Jacob
QCConnection = new ActiveXComponent("TDApiOle80.TDConnection"); Dispatch.call(QCConnection, "InitConnectionEx", sURL); // Login -User and Password Dispatch.call(QCConnection, "Login", sUser, sPassword); int iProjectsCount = Integer.parseInt(Dispatch.call(oProjects, "Count").toString());
通过 ALM>>Help>>Addins 页面注册 HP ALM Client。
下载 Jacob dll(64,32 位),jacob jar
将它添加到您的项目路径。(DLL--> 只需复制粘贴到项目路径),Jacob.jar-->将其添加到构建路径。
创建一个班级
下面的示例代码让您了解如何在 java+Jacob 中使用 COM API
QCConnection = new ActiveXComponent("TDApiOle80.TDConnection"); Dispatch.call(QCConnection, "InitConnectionEx", sURL); // Login -User and Password Dispatch.call(QCConnection, "Login", sUser, sPassword); int iProjectsCount = Integer.parseInt(Dispatch.call(oProjects, "Count").toString());
Below is the JACOB equivalent COM code
下面是 JACOB 等效的 COM 代码
Set QCConnection = CreateObject("TDApiOle80.TDConnection")
QCConnection.InitConnectionEx sQCUrl
QCConnection.Login sUserName, sPassword
回答by Sergi
Please have a look at Agiletestware Bumblebee.
It allows you to integrate HP ALM with Selenium and many more tools.
It also has Java annotations package to integrate your JUnit/TestNG tests with HP ALM by just adding some annotations to your Java code.
请查看Agiletestware Bumblebee。
它允许您将 HP ALM 与 Selenium 和更多工具集成。
它还具有 Java 注释包,只需向 Java 代码添加一些注释,即可将 JUnit/TestNG 测试与 HP ALM 集成。
Disclaimer: I'm a developer of Agiletestware Bumblebee
免责声明:我是 Agiletestware Bumblebee 的开发人员