简体   繁体   English

HP-QTP中是否支持OO语言?

[英]Will there be any support for OO languages in HP-QTP?

It seem to be a pain to stick to procedural kind of programming in Quick Test Professional. 坚持使用Quick Test Professional中的过程式编程似乎很痛苦。 Often large no of lines of code need to be written which otherwise can be not required with OO langiages. 通常,无需编写任何代码行,否则对于OO毛发就不需要。 What do you say? 你说什么?

You can still use inheritance and overloading with VBScript, although not in the same obvious way as in C++. 您仍然可以在VBScript中使用继承和重载,尽管与C ++的明显方式不同。
Check out AdvancedQTP website and articles "Class Composition" or "Function Pointers". 请查看AdvancedQTP网站和文章“类组成”或“功能指针”。
I have an article "Overload your VBScript functions" with code examples in my blog. 我的博客中有一篇文章“重载VBScript函数”,其中包含代码示例。

This all depends on the framework you are using. 这一切都取决于您使用的框架。 Well if you ask me its possible to develop entire framework in ur fav OOP language say either C++ or Java or Python. 好吧,如果您问我有可能用最喜欢的OOP语言开发整个框架,请说C ++或Java或Python。

Let me say how. 我说如何。 if my Test script contains only the following script 如果我的测试脚本仅包含以下脚本

While Environment.value("Statement") <> "" 而Environment.value(“ Statement”)<>“”

Execute Environment.value("Statement") 执行Environment.value(“ Statement”)

Wend 温德

You need to control the environment varialbe from outside using QuickTest API. 您需要使用QuickTest API从外部控制环境变量。 So when you run the test it runs in an infite loop checking the value of the environment value. 因此,当您运行测试时,它会在无限循环中运行,以检查环境值的值。 Now with the help of a ur fav C++ lang, u had set the environment variable value to "Browser("Google").Page("Google").WebEdit("SearchField").Set 'hello' " this value gets reflected in QTP test and executes the statement. 现在,借助一个常用的C ++语言,您已经将环境变量的值设置为“ Browser(“ Google”)。Page(“ Google”)。WebEdit(“ SearchField”)。设置为“ hello”在QTP测试中并执行该语句。

Hence its very much possible to develop you entire framework in java or C++. 因此,很有可能用Java或C ++开发整个框架。 As i said it all depends on the framework ur organisation is using. 正如我所说,这完全取决于组织所使用的框架。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM