Today i got a weird issue, when i compare 2 files in TFS, got the “package did not load correctly” error.
Solution
- Close Visual Studio
- Open a Developer Command Prompt For VS 2012(as administrator)
- Type
devenv /setup
- Restart Visual Studio
izheyi.com
Today i got a weird issue, when i compare 2 files in TFS, got the “package did not load correctly” error.
Solution
devenv /setup
在Linux下安装软件的几种方法,做一个简单的介绍:
rpm -aq mysql
rpm -e [上一步查询到的内容]
rpm -e --nodeps [上一步查询到的内容]
rpm -ivh [rpm软件包]
./configure
make
make install
I got a problem: UFT 12.01 Identifies web object as Window object.
Currently I use UFT 12.01. I rolled back Firefox to v31. It seems UFT 12.01 supports this version. But….
Solution:
Go to “Tools -> Add-ons -> Extensions”, enable Unified Functional Testing Extension.
It should be work now.
Selenium Grid来实现多个nodes间的自动分配,以达到分布式并发的效果。
hub和node的启动和测试脚本,参见:Selenium Grid 初探
这次 TestNG XML 文件如下:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19<suite thread-count="5" parallel="classes" name="demo" >
<test name="test1">
<parameter name="browser" value="ff"/>
<parameter name="nodeUrl" value="http://192.168.24.13:4444"/>
<parameter name="webSite" value="http://www.baidu.com"/>
<classes>
<class name="testGrid2.Grid" />
</classes>
</test>
<test name="test2">
<parameter name="browser" value="chrome"/>
<parameter name="nodeUrl" value="http://192.168.24.13:4444"/>
<parameter name="webSite" value="http://www.baidu.com"/>
<classes>
<class name="testGrid2.Grid" />
</classes>
</test>
</suite>
Notes: url value是Grid Server地址(e.g., WebDriver wd = new RemoteWebDriver("http://localhost:4444/wd/hub"
, ieDesiredcap))。
对想使用Selenium Grid的来说,实现起来应该不会太麻烦,把框架里的单线程运行的公共脚本1
WebDriver wd = new FirefoxDriver();
改成1
2DesiredCapabilities ff = DesiredCapabilities.firefox();
WebDriver wd = new RemoteWebDriver("http://localhost:4444/wd/hub", ff);
然后再把hub的地址设置到Global Setting里边去。
之前研究过Jenkins的应用,知道基本的流程和原理,能进行一些基本的应用。
Grid的好处不多说。Selenium-Grid包括两个部分:
Hub:总控节点,连接调用Node,负责分配用例到对应的Node节点所在的执行器上Node
Node:负责执行TestCase,启动浏览器
举例说一下整个流程:
Start the hub
通过windows的DOS窗口进入selenium-server-standalone-2.48.2.jar所在目录,执行以下命令
1 | java -jar selenium-server-standalone-2.48.2.jar -role hub |
Default port is 4444. To change the default port, you can add the optional parameter -port when you run the command. You can view the status of the hub by opening a browser window and navigating to: http://localhost:4444/grid/console
Start the nodes
进入到node,通过windows的DOS窗口进入selenium-server-standalone-2.48.2.jar所在目录,执行以下命令
1 | java -jar selenium-server-standalone-2.48.2.jar -role node -hub http://localhost:4444/grid/register |
至此,Selenium-Grid就弄成功了,下面我用一个简单的例子来跑一下。
Today i use a previous excel with Macro, but forget the protected password, we can use the following way to unprotect macro password.