angularjs应用程序可以自动与硒?如果是的话,为什么还要用量角器? [英] Can angularjs apps automated with selenium? if yes, why should we use protractor?

查看:163
本文介绍了angularjs应用程序可以自动与硒?如果是的话,为什么还要用量角器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我们能与硒自动化AngularJs应用程序。但我们有一个独立的端到端测试框架,是对量角器应用AngularJs自动化。

I know that we can automate AngularJs apps with selenium. but we have a separate e2e testing framework that is Protractor for AngularJs apps automation.

谁能帮我明白我们为什么要使用量角器?为什么不硒?

Can anyone help me to understand why should we use protractor? why not selenium?

推荐答案

不知道我理解你的问题。我说得对假设你宁愿使用Selenium - 但要知道你错过了什么。

Not sure I understand your question. Am I right to assume you'd rather use Selenium - but want to understand what you're missing?

好 - 硒提供了手段,自动化的网络浏览器 - 因此用于自动化的端到端测试。硒API有几个主​​要的编程语言实现 - 让你写你的测试用Java,C#,Python和Ruby,JavaScript和更多的

Well - Selenium provides means to automate web browsers - and thus used for automated e2e tests. Selenium API has implementations in several major programming languages - allowing you to write your tests in Java, C#, python, ruby, JavaScript and more.

如果你已经有一个适当的基于硒的端到端测试框架 - 您可以使用它也AngularJS Web的应用程序。您也可以编写,使用一次的webdriver跑了必要的JavaScript脚本 - 可以让你做的一切,量角器 - 但你必须做你自己(从量角器源$ C ​​$ C只是借用)

If you already have a selenium-based e2e testing framework in place - you can use it also for AngularJS web-apps. You can also write the necessary JavaScript scripts that, once ran using the webdriver - will let you do all that Protractor does - but you'll have to do it yourself (just borrow from Protractor source code).

为什么可行?由于量角器基本上采取了JavaScript实现硒的webdriver和包裹在一个方式,使您的生活更容易一点测量角JS​​的Web应用程序时。

Why is it doable? Because Protractor basically took the JavaScript implementation of Selenium Webdriver and wrapped it in a way that makes your life a bit easier when testing Angular JS web apps.

您可以看到在这个老矿后的具体说明:
<一href=\"http://testautomation.applitools.com/post/94994807787/protractor-vs-selenium-which-is-easier\">http://testautomation.applitools.com/post/94994807787/protractor-vs-selenium-which-is-easier

You can see specific explanations in this old post of mine: http://testautomation.applitools.com/post/94994807787/protractor-vs-selenium-which-is-easier

我说,如果你:
1.要使用JavaScript编写测试code
2.专注于主要角JS应用

I'd say that if you: 1. want to write your test code in JavaScript 2. are focused on mainly Angular JS apps

您可能要考虑用量角器。再次 - 没有神奇的存在。他们所做的一切都是有他们的来源$ C ​​$ C - 所以你可以把你的选秀权,如果你宁愿坚持硒

You might want to consider using Protractor. Again - no magic there. Everything they did is there in their source code - so you can just take your picks if you'd rather stick with selenium.

这篇关于angularjs应用程序可以自动与硒?如果是的话,为什么还要用量角器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆