如何安装Selenium IDE和快速浏览器自动测试的基本循环。

如何安装Selenium IDE和循环以进行快速的自动化测试。 (How to install Selenium IDE and loops for quick automated testing.)

Get Selenium IDE fromhttp://seleniumhq.org

http://seleniumhq.org 获取Selenium IDE

  • Go to that link and select download selenium in the right hand column

    转到该链接,然后在右侧栏中选择下载Selenium。
  • That will then direct you to their download page.

    然后,您将直接进入他们的下载页面。
  • From that page select to download the latest version of the selenium IDE

    从该页面选择下载最新版本的Selenium IDE

This extension will allow for the use of loops, goto and gotoIf's.

此扩展将允许使用循环,goto和gotoIf。

  1.  Launch Selenium IDE from Firefox and open the options menu within Options

    从Firefox启动Selenium IDE,然后在“选项”中打开选项菜单
  2.  Browse then Add the sideflow.js file to the "Selenium Core extensions (user-extensions.js)" field

    浏览,然后将sideflow.js文件添加到“ Selenium Core扩展(user-extensions.js)”字段
  3.  Select OK

    选择确定
  4.  Close the IDE and then re-open it.

    关闭IDE,然后重新打开它。

Adding-loop-js.jpg

  • The image above this is just an example of where you would want to add your loops.js file.

    上面的图像只是您要在其中添加loops.js文件的示例。

To set up a generic loop for testing enter the following values into the table.

要设置测试通用循环,请在表中输入以下值。

Command: store | Target: Any Numerical Value | Value: Y
Command: store | Target: 0 | Value: X
Command: label | Target: target1 | Value: 
  • The stored target for Y is how many times the loop will be performed.

    Y的存储目标是执行循环的次数。
  • To turn the recorder ON use the button in the top right corner.

    要打开录音机电源,请使用右上角的按钮。
  • Then with the recorder ON perform whatever action you wish to get automated within firefox.

    然后在录音机打开的情况下,执行您希望在firefox中自动执行的任何操作。
  • As you perform certain actions you will notice it appearing in the driver.

    当您执行某些操作时,您会注意到它出现在驱动程序中。

Once that task has been completed, put the following at the bottom of the table.

该任务完成后,将以下内容放在表格底部。

Command: store | Target: ${X}+1  | Value:  X
Command: gotoIf  | Target: ${X}<${Y}  | target1 

Now the test is ready to be run with the loops. Here is a quick example of a simple test to run.

现在该测试已准备好与循环一起运行。 这是运行简单测试的快速示例。

Basic-search-loop.jpg
In the example above, automation will perform a search on bing two times. This is of course just an example, you likely would not want to do this as part of your testing.

在上面的示例中,自动化将对bing执行两次搜索。 当然,这只是一个例子,您可能不想在测试中进行此操作。

Another handy thing within Selenium IDE is that you can change your clipboard format.

Selenium IDE中的另一件方便的事是您可以更改剪贴板格式。

Clipboard-format.jpg
Here is a helpful link for additional documentation from Selenium: http://docs.seleniumhq.org/docs/02_selenium_ide.jsp

这是Selenium其他文档的有用链接: http : //docs.seleniumhq.org/docs/02_selenium_ide.jsp

http://www.seleniumhq.org/

http://www.seleniumhq.org/

翻译自: https://www.experts-exchange.com/articles/17457/How-to-install-Selenium-IDE-and-a-basic-loop-for-quick-automated-browser-testing.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值