学习从手动测试转向自动化/编程的语言

发布于 2024-09-11 07:35:39 字数 1432 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

扮仙女 2024-09-18 07:35:40
  1. Selenium 在 QA 级别的自动化测试中非常受欢迎。
  2. 无论您做什么,都会有一些与您的解决方案相关的学习曲线
  3. Selenium 的重点是为 Web 应用程序提供一个测试框架——您使用 Selenium 来操作浏览器中的 DOM 元素,而不是应用程序的运行版本。
  4. Selenium 是一种客户端/服务器模型(您在可以访问 QA 应用程序实例的地方运行服务器;您使用客户端库编写测试代码),它提供多种语言(java、ruby 等)的客户端< /p>

  5. <如果您有可以编写代码的专用 QA 资源,这种类型的测试是一个好主意。它提供了一些高级回归测试。然而,它也有其缺点:(1) 测试可能需要一些时间来运行,(2) 您可能需要对 Web 应用程序 dom 元素进行一些更改才能轻松使用框架,(3) 更改 Web 应用程序将需要更改您的测试代码,这可能很重要。

您的其他选择是为应用程序代码编写单元测试。通常开发人员将其作为测试驱动过程的一部分来执行。因此,开发人员需要进行 TDD,QA 需要进行自动化 QA 测试。

  1. Selenium is very popular for automated testing at the QA level.
  2. No matter what you do, there will be some learning curve associated with your solution
  3. The point of Selenium is to provide a testing framework for webapps -- you use Selenium to manipulate DOM elements in the browser, no a running version of your application.
  4. Selenium is a client/server model (you run the server somewhere that has access to your QA app instance; you code your tests using the client libraries) that provides clients in a number of languages (java, ruby, etc)

  5. This type of testing is a good idea if you have have dedicated QA resources that can write code. It provides some high level regression testing. However it is not without its drawbacks: (1) tests can take some time to run, (2) you might need to make some changes to your web application dom elements to use the framework easily, (3) changing the web app will require changing your testing code, which can be non trivial.

Your other options is to write unit tests for the application code. Usually the developers do this as part of a test-driven process. So there is TDD for developers and then automated QA testing for QA.

如梦初醒的夏天 2024-09-18 07:35:40

我还要添加一个小评论

有一个新的测试自动化平台 XML2Selenium

这个平台构建在 classis Selenium 框架之上,并提供了许多有用的功能

但它非常容易使用

你不需要学习任何 java 或 ruby​​ - 你 用 XML SMth 编写

可以像这样

<!-- here we have some imports Frame - is like a class, you can extend it with extends -->
<import resource="Demo.a-server/03Registration/framesRegist.xml" name="frames"/>
<import resource="Demo.a-server/01Action/FramesAction.xml" name="framesAct"/>
<import resource="Demo.a-server/03Registration/FramesLogin.xml" name="framesLog"/>

<property resource="Demo.a-server/LogValue.properties" name="logValue"/>
<test name="creatAction" description="create and check action">

<frame extends="frames:logAdmin"/>
<frame extends="framesAct:createAct"/>

// here we upload the image
<upload id="img_id0" resource="image.jpg"/>

// click save button with id=save
<button id="save" />

// make a screen shot 
<screenshot/>

// sleep for 3 seconds 
<pause time="3000" />

// make a screenshot again
<screenshot/>

// navigate to the given URL:
<navigate to="${logValue.baseUrl}/admin"/> 

<frame extends="framesLog:logOutAdmin"/>
<pause time="1000"/>
</test> 

:在这里您可以看到有错误的报告:
http://xml2selenium.com/demored/xml2selenium/

在这里您可以看到状态成功的报告:
http://xml2selenium.com/demogreen/xml2selenium/

PS:它支持在所有浏览器中进行测试,而不是仅在 Firefox 中作为 Selenium IDE

I will also add a small comment

There is a new testing automation platform XML2Selenium

This platform is built on top of classis Selenium framework and provides many useful features

But it is quite easy to use

You don't need to learn any java or ruby - you can write in XML

SMth like that:

<!-- here we have some imports Frame - is like a class, you can extend it with extends -->
<import resource="Demo.a-server/03Registration/framesRegist.xml" name="frames"/>
<import resource="Demo.a-server/01Action/FramesAction.xml" name="framesAct"/>
<import resource="Demo.a-server/03Registration/FramesLogin.xml" name="framesLog"/>

<property resource="Demo.a-server/LogValue.properties" name="logValue"/>
<test name="creatAction" description="create and check action">

<frame extends="frames:logAdmin"/>
<frame extends="framesAct:createAct"/>

// here we upload the image
<upload id="img_id0" resource="image.jpg"/>

// click save button with id=save
<button id="save" />

// make a screen shot 
<screenshot/>

// sleep for 3 seconds 
<pause time="3000" />

// make a screenshot again
<screenshot/>

// navigate to the given URL:
<navigate to="${logValue.baseUrl}/admin"/> 

<frame extends="framesLog:logOutAdmin"/>
<pause time="1000"/>
</test> 

Here you can see report with errors:
http://xml2selenium.com/demored/xml2selenium/

And here you can see report with successful state:
http://xml2selenium.com/demogreen/xml2selenium/

PS: It supports testing in All browsers, not only in Firefox as Selenium IDE

明天过后 2024-09-18 07:35:40
  • 是的,你可以学习selenium IDE,它就像firefox浏览器上的一个插件,使用它你可以记录你的测试并在需要时播放它们。 IDE的限制是它只能在firefox上使用。

  • 如果您希望在多个浏览器上进行测试,则需要 Selenium Grid 或 WebDriver,这需要具备 java 知识。同样,您不需要成为 Java 专业人士即可执行此操作,简单的学习就会有所帮助。

  • 您可以在 youtube.com 上搜索 Selenium 教程。

Selenium 的优点:

  1. 它是开源的!
  2. 它易于学习和实现。
  3. 支持多种浏览器。
  4. 支持多种脚本/编程语言。
  5. 灵活的选择,简单的录制和播放(IDE),通过使用您最喜欢的编程语言进行选择的完整框架设计。
  6. 支持并行执行。

希望这会对您有所帮助。

  • Yes you can learn selenium IDE, Its just as an add-on on the firefox browser, using which you can record your tests and play them when required. The limitation of IDE is it can only be used on firefox.

  • If you are looking to test on multiple browsers, you need Selenium Grid or WebDriver, which requires a knowledge of java. And again you are not needed to be a Java pro to do this, a simple learning will help.

  • You can search the youtube.com for Selenium Tutorials.

Advantages of Selenium :

  1. Its Open sourse!!
  2. Its easy to learn and impliment..
  3. Supports multiple browsers.
  4. Supports multiple scripting/programming languages.
  5. Flexible to your choice, simple record and playback (IDE), Comple Framework design to your choice by using your favorite programming language.
  6. Supports parellel execution.

Hope this will help you.

谈下烟灰 2024-09-18 07:35:39

哇,这是一个非常广泛的问题。我想说,随着行业朝着测试驱动开发发展,您处于有利的位置(或者在代码之前编写测试)模型。

首先,您需要了解单元测试持续集成和 Web 自动化。

我将重点关注我所了解的领域(.NET、Java、Javascript、构建自动化、Selenium)

  1. In .NET NUnit 可能是使用最广泛的单元测试框架。它是 Java 世界中 JUnit 的端口(副本)。大多数单元测试框架在概念上与这些框架非常相似。因此,学习其中一个之后,您很快就会学会其他的。

  2. 我认为阅读上述链接并了解这些概念将使您上路。使用 Python 或 Ruby 进行试验可能值得,因为它们的入门门槛较低,可以进行一些简单的测试。

  3. 对于基于网络的测试,最知名的可能是 SeleniumWatin。这些允许您编写浏览器脚本以自动执行操作。然而,我很少遇到这些好的用法,而且它们的设置和使用都非常繁琐(你说的是几天/几周的努力)。同样,无论您使用什么框架,这些背后的概念都是相似的。

    我想我在 1,2,3 中回答了 4,5,6 :-)

HTH

Wow this is quite a widesweeping question. I'd say you were in a good position as the industry moves towards a Test Driven Development (or write your tests before your code) model.

First of all you'll want to know about Unit Testing, Continuous Integration and Web Automation.

I'm going to focus on the areas I know (.NET, Java, Javascript, Build automation, Selenium)

  1. In .NET NUnit is probably the most widely used unit testing framework. It is a port (copy of) JUnit in the java world. Most unit testing frameworks are very similar to these in terms of the concepts. So learn one and it won't take you long to pick up the others.

  2. I think reading the above links and having an idea about these concepts will get you on your way. It's probably worth experimenting with Python or Ruby as these have low barriers to entry to mess around with some simple tests.

  3. For web based testing the most well known are probably Selenium and Watin. These allow you to script browsers to perform actions automatically. However, I have come across very few good usage of these and they are very fiddly (you're talking days/weeks of effort) to get set up and useful. Again the concepts behind these are similar whatever framework you use.

    Think I answered 4,5,6 in 1,2,3 :-)

HTH

寄离 2024-09-18 07:35:39

至于“产业优势”,这取决于你的意思。

对于大公司来说QTP被广泛使用。使用QTP要学习的并不是语言,而是工具本身。对我来说,克服工具细节比学习 VBscript 更麻烦。如果您考虑性能测试,那么 PerformanceCenter 可能是您的选择。这里有 C 作为语言,但同样,使用工具比使用语言更困难。
在一些公司中,有来自 IBM 的堆栈,因此 Rational 软件可以发挥作用(FunctionalTester、Robot、PerformanceTester)。还有一些工具复杂性需要解决(IBM Redbobks 可以提供帮助)。

在较小的公司中,Java/C# 可能会有所帮助。在这里你可以熟悉junit/nunit/TestNG/MSTest。对于 Web 应用程序,像 Selenium/Watij/Watin/Fit/Fitness/Concordian 之类的东西值得一看。如果您有时间看一下 AutoIT、PowerShell、Python、Fiddler、Jmeter、Abbot、Watir/Cucumber、Sikuli。

还有很多其他工具,例如 WebAii、TestComplete、Twist...其他一些商业工具。通常你可以让他们试用一两周。

一切都取决于你将接触什么样的项目,以及它将是什么样的公司。

无论如何,在我看来,学习一定程度的 Java/C# 就足够了。您不需要成为 C#/Java 忍者,了解每个库,并非常努力地学习给定的语言。您会看到,开发软件不仅仅是了解一种编程语言,而测试自动化不仅仅是了解一种工具/语言(M. Fewster 和 D. Graham),所以不要对此过于着迷。如果您可以在 QTP 中编写脚本(不是记录,而是编程、使用描述性编程、将逻辑分解为库、通过适当的方法完全控制测试结果等),那么其他工具就不会成为问题。您可能需要一两周的时间来学习给定语言的基础知识,但这就是测试自动化的全部内容(至少对于开始而言)。你需要更多的经验,了解工具,了解概念,了解不同方法的优缺点,头脑中有更大的图景,而不仅仅是“我如何用那种语言写这个”(你有这样的想法) :D)。

As for 'industrial advantage' it depends what you mean by that.

For big companies QTP is widely used. Thing to learn with QTP is not really the language, but the tool itself. For me it was more troublesome to overcome tool specifics than learning VBscript. If you would think about performance testing, than PerformanceCenter would be probably the choice. Here you have C as language but again, there is more struggle with a tool than with a language.
In some companies there is stack from IBM, so Rational software comes to play (FunctionalTester, Robot, PerformanceTester). There is also a bit of tool complexity to get through (IBM Redbobks can help).

In smaller companies Java/C# could be beneficial. Here you can get familiar with junit/nunit/TestNG/MSTest. For webapps things like Selenium/Watij/Watin/Fit/Fitness/Concordian are worth to look at. If you have a moment look at AutoIT,PowerShell,Python,Fiddler,Jmeter, Abbot, Watir/Cucumber,Sikuli.

There is also lots of other tools like WebAii, TestComplete, Twist.. some others commercial tools. Usually you can get trials for them to play with it for week or two.

Everything depends on what kinds of project you will be exposed to, and what kind of company it will be.

Regardless, in my opinion it is enough to learn Java/C# to some degree. You don't need to be C#/Java ninja, know every library, and study really hard given language. You see Developing software is more than knowing a programming language, and test automation is more than knowing a tool/language (M. Fewster & D. Graham), so don't get obsessive about it. If you can program script in QTP (not record but program, using Descriptive Programming, decomposing logic to libraries, having full control of TestResults via proper methods etc.), than other tools won't be an issue. You may need like week or two to learn basics of given language, but that is all for test automation (for start at least). You need more to have some experience, to know tools, to know concepts, to know pros and cons of different approaches, to have bigger picture in head, than just 'how do I write this in that language' (you have SO for this :D ).

盛夏尉蓝 2024-09-18 07:35:39

这个问题的答案实际上取决于几件事。首先,你在做什么类型的测试?测试基于网络的应用程序?测试大型程序的库/组件?图形用户界面测试?测试命令行应用程序?

我发现以下内容在创建脚本/自动化测试工具时很有用:

TCL - TCL 可以与命令行交互与批处理文件一样简单,但具有强大的语言,可以使批处理脱颖而出(包括 GUI 功能)。如果您正在编写基于 Windows 的控制台应用程序的脚本(为了测试它们或使用它们来测试其他内容),我建议花时间学习 TCL。

AutoIt - 此脚本语言可让您快速轻松地自动执行与 Windows 应用程序的 UI 交互。它也相当容易学习。如果您想花时间和精力开发一个屏幕抓取实用程序,您可以将其与 AutoIt 结合起来创建一些相当复杂的测试系统。

C - 在测试编译库时,我使用优秀的 C 取得了令人惊讶的成功。我将为测试应用程序编写基本框架,并创建一个脚本化实用程序,该实用程序将根据测试动态生成其余代码需要运行(我给它一个示例 C 代码片段库,它可以用于更复杂的任务)。

Ruby - 当您进行自动化测试时,强大的脚本语言可以走得很远。无论您需要解析测试日志、生成报告还是自动生成测试脚本,您熟悉的脚本语言都可以为您节省大量时间并减少头痛。我选择的语言是 Ruby,但我公司的其他人更喜欢其他语言,例如 Perl 或 Python。语言的选择并不是太重要,选择一门并学好它。

根据您正在测试的内容,您还可能在您正在测试的代码中内置了某种测试工具。 Java 代码有时使用 JUnit 测试编写,Ruby 代码可以使用 Test::Unit 框架等。这里< /a> 是适用于多种语言的单元测试框架的列表。如果您正在测试的代码是在考虑单元测试的情况下构建的,那么您将需要学习编写代码所用的语言,以便可以利用这些单元测试。

The answer to this question really depends on a couple of things. First, what kind of testing are you doing? Testing web-based applications? Testing libraries/components of a larger program? GUI testing? Testing command-line apps?

I have found the following useful when creating scripted/automated test facilities:

TCL - TCL can interface with the command line as easily as a batch file, but has a powerful language that blows batch out of the water (including GUI capabilities). If you are scripting Windows-based console apps (either to test them or to use them to test something else), I recommend taking the time to lean TCL.

AutoIt - This scripting language lets you automate UI interaction with Windows apps quickly and easily. It is also fairly easy to learn. If you want to take the time and trouble to develop a screen-scraping utility, you can combine it with AutoIt to create some pretty sophisticated test systems.

C - When testing compiled libraries, I have had a surprising degree of success using good 'ol C. I'll write the basic skeleton for a test app and create a scripted utility that will dynamically generate the rest of the code based on what tests need to be run (I give it a library of sample C snippets that it can use for more complicated tasks).

Ruby - When you are doing automated testing, a robust scripting language can go very far. Whether you need to parse test logs, generate reports, or auto-generate test scripts, a scripting language that you know well can save you a lot of time and headache. My language of choice is Ruby, but others at my company prefer other languages such as Perl or Python. Language choice isn't too important, pick one and learn it well.

Depending on what it is that you are testing, you may also have some sort of testing tools built into the code that you are testing. Java code is sometimes written with JUnit tests, Ruby code can use the Test::Unit framework, etc. Here is a list of unit testing frameworks for a wide variety of languages. If the code you are testing was built with unit testing in mind, you will want to learn the language the code was written in so that you can take advantage of these unit tests.

在巴黎塔顶看东京樱花 2024-09-18 07:35:39

对于基于网络的测试,您可能需要查看 fitnesse。此外,基于 Python 构建的自动化测试框架是机器人框架

For web based testing you might want to check out fitnesse. Also, an automated test framework built on python is the robot framework.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文