1. 安装配置远程桌面服务

image.png
image.png
配置远程桌面授权服务
image.png
image.png

image.png
image.png

image.png

image.png
image.png
image.png

2. 配置IE

image.png

3. 安装NodeJs

安装请访问官网:https://nodejs.org,如果已安装好,请略过
为了稳定,建议安装LTS版本
image.png

4. 安装Java

安装请访问官网:https://java.com/zh_CN/download/
用于运行WebDriver Server(Selenium2)
image.png
image.png

5. 下载f2etest-webdriver

下载并拷贝 https://github.com/alibaba/f2etest/tree/master/f2etest-client/f2etest-webdriver,放到C盘更目录下C:\f2etest-webdriver

6. 初始化子节点账号数据

  1. 打开组策略(gpedit.msc),关闭密码复杂性要求

image.png

  1. 批量设置脚本.vbs变更 ```vbnet ‘ 以管理员运行 Set WshShell = WScript.CreateObject(“WScript.Shell”) If WScript.Arguments.Length = 0 Then Set ObjShell = CreateObject(“Shell.Application”) ObjShell.ShellExecute “wscript.exe” _ , “””” & WScript.ScriptFullName & “”” RunAsAdministrator”, , “runas”, 1 WScript.Quit End if

dim nodeCount nodeCount = InputBox(“请输入节点数量!”) if nodeCount <> “” and IsNumeric(nodeCount) then nodeCount = CInt(nodeCount) if nodeCount <= 32 then for i = 1 to nodeCount setUserPassword “node”+iif(i<10,”0”,””)+CStr(i),”hello1234” next msgbox “初始化结束!” else msgbox “节点数量请不要超过32!” end if

else msgbox “节点数量必需为整数!” end if

function setUserPassword(username, password) On Error Resume Next dim oSystem,oUser,oGroup

  1. Set oSystem=GetObject("WinNT://127.0.0.1")
  2. Set oUser=oSystem.GetObject("user",username)
  3. if err.number <> 0 then
  4. ' 增加新用户
  5. Set oUser=oSystem.Create("user",username)
  6. oUser.SetPassword password
  7. oUser.Put "userFlags", &h10040 '密码永不过期
  8. oUser.Setinfo
  9. Set oGroup=oSystem.GetObject("Group","Administrators")
  10. oGroup.Add ("winnt://"&username)
  11. err.clear
  12. else
  13. ' 修改密码
  14. oUser.SetPassword password
  15. oUser.Setinfo
  16. end if

end function

function iif(expression,returntrue,returnfalse) if expression=0 then iif=returnfalse else iif=returntrue end if end function ``` 初始化成功,可在本地用户中看到初始化的节点用户
image.png

7. 初始化环境变量

C:\f2etest-webdriver\webdriver\文件夹添加到PATH环境变量中
image.png

8. 初始化webdriver节点

  1. 执行RDP.exe
    2. password处输入:hello1234
    3. 点击Encrypt按钮
    4. 复制出加密后的Hash
    注:由于不同系统生成的Hash不同,因此,这个值需要在每台执行机上进行动态生成并替换
    5. 替换当前子文件夹中所有rdp扩展名的文件,替换password_hash为刚才复制的加密后Hash
    image.png

  2. 修改C:\f2etest-webdriver\webdriver\opennode.bat

  3. 修改f2etestHost变量为f2etest服务部署的IP地址或域名
  4. browsers变量修改为本机所部署的浏览器名称,多个浏览器以逗号间隔,浏览器名称和浏览器版本号之间以空格间隔,例如: IE 11,Chrome,Firefox

9. 启动节点

  1. 手动点击 C:\f2etest-webdriver\rdp\node01~node08.rdp ,(初始化用户文件夹)
  2. 执行 C:\f2etest-webdriver\rdp\initAllNodes.bat ,(将opennode快捷方式添加到每个用户的启动菜单中)
  3. 执行rdp\openAllNode.bat,然后打开一次所有的IE浏览器,进行首次初始化,同时启用所有安全区域的保护模式