duanchensou8685 2016-01-11 05:48
浏览 966

Go Lang中的自动化-如何使用Selenium等浏览器自动化?

I am new to Go lang. And I am looking for automating signup, login processes in a web app. Please suggest a good tool like Selenium and how can I implement it in go language.

I want to do the following process automatically using Go Lang:

  1. Start a browser. Currently, I'm using https://github.com/skratchdot/open-golang
  2. Auto entry in signup page and auto submit a form.
  3. Login check for the registered user. Everything needs to be done automatically for more users.
  • 写回答

2条回答 默认 最新

  • dsf487787 2016-01-11 10:33
    关注

    If you are going to use GO for web automation testing - Selenium is a good option. Still it's nothing more than a library that allows you to interact with browsers. So you are going to need to develop your own framework or reuse someone already implemented.

    My advice is to consider Agouti, since it supports Ginkgo BDD and xUnit Gomega. Everything else is pretty much the same from architectural perspective. You can design it like any other language binding. There are common patterns that appear over and over again in browser automation frameworks, like

    • PageObjects: A simple abstraction of the UI of your web app.
    • LoadableComponent: Modeling PageObjects as components.
    • BotStyleTests: command-based approach

    Another good resource for building your Test framework is the xunitpatterns guide. It gives a great content overview of the patterns, smells and refactoring strategies you can use. Also look at this test frameworks tutorial. It'll help you choose the most proper solution for your case.

    My guess is that you are going to need some CI server support for

    everything needs to be done auto for more users.

    Here is a good article how-to achieve this with TravisCI.

    评论

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?