java Netbeans 和 Selenium 入门
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14974570/
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
Getting started with Netbeans and Selenium
提问by coure2011
I want to create a new project in Netbeans that will be used for testing a web application using Selenium 2. I am not sure how to get started.
我想在 Netbeans 中创建一个新项目,用于使用 Selenium 2 测试 Web 应用程序。我不知道如何开始。
Is there any simple step by step tutorial to follow for Netbeans + Selenium?
Netbeans + Selenium 是否有任何简单的分步教程可以遵循?
What type of new project do I need to create in Netbeans so that I can run tests?
我需要在 Netbeans 中创建什么类型的新项目才能运行测试?
采纳答案by Manigandan
Open a New java project in your IDE.
在 IDE 中打开一个新的 java 项目。
Download the Selenium Standalone server here
在此处下载 Selenium 独立服务器
Put the jar file in the lib and Start to create your Selenium test cases.
将 jar 文件放在 lib 中并开始创建您的 Selenium 测试用例。
If you want to run it on Chrome then download the chromedriver.exe
file here
如果您想在 Chrome 上运行它,请在此处下载chromedriver.exe
文件
For to run on IE download the IEDriverServer.exe
for respective bit version here
要在 IE 上运行,请在此处下载IEDriverServer.exe
相应的位版本
Sample code:
示例代码:
WebDriver driver = new FirefoxDriver();
driver.get("URL");
//Do some actions
driver.quit();
回答by Adalarasan_Serangulam
Check out "Quick Tutorial: Netbeans + Selenium + Hudson"; it contains a screen shot also.
查看“快速教程:Netbeans + Selenium + Hudson”;它也包含一个屏幕截图。
Also see "Selenium Tutorial for Beginner/Tips for Experts"
另请参阅“ Selenium 初学者教程/专家提示”