您的位置:软件测试 > 开源软件测试 > 开源功能测试工具 > Selenium
轻松自动化---selenium-webdriver(python) (十四)
作者:网络转载 发布时间:[ 2013/9/16 10:02:59 ] 推荐标签:

  再次发送定位输入框的请求
  10:20:41.843 INFO - Executing: [find element: By.name: q] at URL: /session/ac5b2
  c71-5b1a-469e-814c-fdd09a2061fc/element)
  [3.006][INFO]: received Webriver request: POST /session/32b33aa585ccbbf7ba785358
  82852af3/element {
   "using": "name",
   "value": "q"
  }
  [3.006][INFO]: waiting for pending navigations...
  [3.006][INFO]: done waiting for pending navigations
  [3.016][INFO]: waiting for pending navigations...
  [3.016][INFO]: done waiting for pending navigations
  [3.016][INFO]: sending Webriver response: 200 {
   "sessionId": "32b33aa585ccbbf7ba78535882852af3",
   "status": 0,
   "value": {
      "ELEMENT": "0.19427558477036655:1"
     }
  }
  10:20:41.859 INFO - Done: /session/ac5b2c71-5b1a-469e-814c-fdd09a2061fc/element
  10:20:41.859 INFO - Executing: [send keys: 0 org.openqa.selenium.support.events.
  EventFiringWebDriver$EventFiringWebElement@a8215ba9, [k, e, y, ., E, N, T, E, R]
  ] at URL: /session/ac5b2c71-5b1a-469e-814c-fdd09a2061fc/element/0/value)

  对定位的到的输入框发送回车(ENTER)事件请求
  [3.021][INFO]: received Webriver request: POST /session/32b33aa585ccbbf7ba785358
  82852af3/element/0.19427558477036655:1/value {
   "id": "0.19427558477036655:1",
   "value": [ "k", "e", "y", ".", "E", "N", "T", "E", "R" ]
  }
  [3.021][INFO]: waiting for pending navigations...
  [3.021][INFO]: done waiting for pending navigations
  [3.064][INFO]: waiting for pending navigations...
  [3.064][INFO]: done waiting for pending navigations
  [3.064][INFO]: sending Webriver response: 200 {
   "sessionId": "32b33aa585ccbbf7ba78535882852af3",
   "status": 0,
   "value": null
  }
  10:20:41.906 INFO - Done: /session/ac5b2c71-5b1a-469e-814c-fdd09a2061fc/element/
  0/value
  10:20:41.906 INFO - Executing: [close window] at URL: /session/ac5b2c71-5b1a-469
  e-814c-fdd09a2061fc/window)
  [3.068][INFO]: received Webriver request: ELETE /session/32b33aa585ccbbf7ba78535
  882852af3/window
  [WARNING:chrome_desktop_impl.cc(88)] chrome detaches, user should take care of d
  irectory:C:DOCUME~1ADMINI~1LOCALS~1Tempscoped_dir1808_7550 and C:DOCUME~1
  ADMINI~1LOCALS~1Tempscoped_dir1808_26821
  [5.318][INFO]: sending Webriver response: 200 {
   "sessionId": "32b33aa585ccbbf7ba78535882852af3",
   "status": 0,
   "value": null
  }
  10:20:44.156 INFO - Done: /session/ac5b2c71-5b1a-469e-814c-fdd09a2061fc/window

  request 请求 / response 应答

  一次请求会对应一次应答

  POST/GET  是请求(request)两种类型;关于两种请求方式的类别参考其它资料

  200 、203 是 HTTP请求返回的状态码,200表示成功;

  sessionid :每一个访问服务器的客户端,都要先得到服务器端分配的一个sessionid ,像通行证一样,只有得到sessionid的客户端才能向服务器请求想要的数据。

  其它还包括操作系统版本,浏览器类型、URL、字符类型等非常详细的记录。熟悉HTTP ,了解TCP 的三次握手四次挥手,相信你对浏览器的交互与webdriver原理会有更深入的认识。

相关链接:
上一页1234下一页
软件测试工具 | 联系我们 | 投诉建议 | 诚聘英才 | 申请使用列表 | 网站地图
沪ICP备07036474 2003-2017 版权所有 上海泽众软件科技有限公司 Shanghai ZeZhong Software Co.,Ltd