Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Universal game server testing bot; 通用游戏服务器测试机器人

License

NotificationsYou must be signed in to change notification settings

pojol/gobot

Repository files navigation

Gobot is a powerful stateful API testing robot. It provides a graphical interface for building test scenarios, allows for easy test script writing, step-by-step debugging and pressure testing, and can share and store states between each stage of the testing process.

Go Report Card

中文

Quick Installation

  • windows
  1. Go to therelease page and download the executable program.
  2. Run the server by executing the run.bat file in the gobot_driver_win_x64_v0.3.8 directory.
  3. Run the editor program by executing gobot.ext in the gobot_editor_win_x64_v0.3.8 directory.
  4. Fill in the address input window that pops up or the address bar on the config page withhttp://127.0.0.1:8888, the local server address.

Feature

  • Utilizes the 'behavior tree' to control the robot's execution order and uses 'scripts' for specific node behaviors, such as making HTTP requests.
  • Provides graphical editing and debugging capabilities.
  • Allows creating and reusing 'prefab' template nodes in the configuration page.
  • Supports driving via HTTP API (post /bot.run -d '{"Name":"a robot"}'), making it easy to integrate into CI.
  • Supports multiple protocol formats (HTTP, TCP, WebSocket...) and supports pack/unpack of byte streams at the script layer
  • Offers 'stress testing' with configurable concurrency settings on the configuration page.

NodeScript

Through built-in modules and scripts, we can have rich logical expression capabilities. We can also use global (single bot) meta structures to maintain various state changes of the bot.

--[[    Each node has its own independent .lua script for execution. When a node is executed, the script is loaded and run using dostring.    Users can load desired 'modules' into the script for additional functionalities. For more information, refer to the documentation.    The script allows defining node execution logic, like sending an HTTP request.]]---- Users can load "modules" they want to use in the script.-- document https://pojol.github.io/gobot/#/localhttp=require("http")-- request bodyreq= {body= {},-- post bodytimeout="10s",-- http timeoutheaders= {},-- http headers}-- When the robot runs to a node, the execute function will be executed.functionexecute()-- Here, users can define the execution logic of nodes themselves (for example, sending an HTTP request)res,err=http.post("url",req)-- todo--  state - State code--  res - Information displayed in the Response panelreturnstate.Succ,resend

Script Module

ModuleinterfaceDescription
base64encodedecodeProvides base64 encoding/decoding functionality.
httppostgetputSupport HTTP connection.
tcpdailclosewritereadSupport TCP connection.
websocketdailclosewritereadSupport WebSocket connection.
protobufmarshalunmarshalProvides Protobuf operations.
mongoDBinsertfindupdatedelete ...Provides MongoDB operations.
jsonencodedecodeOffers JSON functionalities.
md5sumCalculates MD5 hashes.
utilsuuidrandomGenerates random values, UUIDs.
...More modules available.

Parsing Stream Protocol Packets

Example message.lua is located in script/. Users can refer to its implementation and modify the protocol packet parsing method in their own projects

-- message.lua--[[    | 2 byte  |  1 byte     | 2 byte  |    2byte        |                        |    |msg len  |  proto type | custom  |   msgid         |                        |    |                  header                           |         body           |]]--functionTCPUnpackMsg(msglen,buf,errmsg)iferrmsg~="nil"thenreturn0,""endlocalmsg=message.new(buf,ByteOrder,0)localmsgTy=msg:readi1()localmsgCustom=msg:readi2()localmsgId=msg:readi2()localmsgbody=msg:readBytes(2+1+2+2,-1)returnmsgId,msgbodyendfunctionTCPPackMsg(msgid,msgbody)localmsglen=#msgbody+2+1+2+2localmsg=message.new("",ByteOrder,msglen)msg:writei2(msglen)msg:writei1(1)msg:writei2(0)msg:writei2(msgid)msg:writeBytes(msgbody)returnmsg:pack()end-- use---------------------------------------------------------- Serialize using proto.marshal-- Assemble TCP packet using TCPPackMsglocalreqbody,errmsg=proto.marshal("HelloReq",json.encode({Message="hello",}))ret=conn.write(TCPPackMsg(1002,reqbody))---------------------------------------------------------- 2 is the designed byte length of the message length, conn will first attempt to read the specified bytes for parsing the message size-- Parse protocol message content based on msgid-- TCPUnpackMsg can be user-defined, not necessarily returning in the form of msgid, msgbody, it can also be msghead, msgbody depending on the user's message structure designmsgid,msgbody=TCPUnpackMsg(conn.read(2))ifmsgid==1002thenbody=proto.unmarshal("HelloRes",msgbody)end

Try it out

Try the editor outon websitedriver server addresshttp://47.120.59.203:8888

Preview

image.png

About

Universal game server testing bot; 通用游戏服务器测试机器人

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp