Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Saving Test Procedure as an API Keyword

Updated on 2025-01-10 GMT+08:00

Background

API keywords define the request of a single API, and can be generated by importing a Swagger file or saving a user-defined URL request.

Swagger is a tool for defining, developing, and debugging APIs such as RESTful. Swagger can be used to define API attributes in a standardized manner, facilitating interconnection and interworking. API automation allows you to import API description files in Swagger 2.0 and 3.0 format, parse API definition descriptions, and generate a script template. You only need to enter API parameters based on the template to create automated API test cases.

You can import a Swagger API description file to generate a script template. A script template corresponds to an API definition in the Swagger file. Test cases can be orchestrated in a visualized manner based on the script template.

The following tables show the mapping between the script template and the fields in the Swagger API description.

  • Swagger 2.0 format

    Script Template Attribute

    Swagger API Definition Attribute

    Name

    By default, operationId is used. You can set it to summary.

    Path

    schema + :// + basePath + path.

    Request parameter hostURL

    host

    Other request parameters

    parameters

  • Swagger 3.0 format

    Script Template Attribute

    Swagger API Definition Attribute

    Name

    By default, operationId is used. You can set it to summary.

    Path

    url + path

    Request parameter hostURL

    servers:

    - URL: https://{hostURL}/variable

    variables:

    hostURL:

    default: test.demo.com

    Other request parameters

    parameters, requestBody, and responses

Importing a Swagger File to Generate a Test Script

  1. After the operations described in Creating an Automated API Test Case Template are complete, click the test case name, and click the Scripting tab.
  2. On the Keyword Library page on the right, click Import API.

  3. Click Click to add file or drag upload, select the configured Swagger API file, and click OK.
  4. After the file is imported successfully, the system automatically parses and generates a script template. The script template contains the basic description of the API. You can click or drag and drop an API on the Keyword Library page to add it to the test step. You only need to enter the API parameters based on the template to perform the test.

Saving a Customized API Keyword

  1. After the operations described in Creating an Automated API Test Case Template are complete, click the automated API test case name and click the Scripting tab.
  2. After the operations described in Adding an API Test Script by Using a Custom URL Request are complete, select the test step to be set as a keyword (only for custom URL request steps), and click at the upper right corner of the test step page to save the API keyword.

  3. On the page that is displayed, set API Keyword and Description, and select the directory for storing the keyword. By default, keywords are stored in Default Folder under API > Keyword.

  4. Click Save.

Managing Existing Keywords

For an added keyword, you can hover the cursor over the keyword area and perform the following operations:

  • Click a keyword name to view the details about the keyword.
  • Click on the right of the Keyword to create a folder. Save the keyword set in Step 3 to a custom folder.
  • Hover the cursor over the left area of a keyword name to adjust the keyword sequence.
  • Click or hover the cursor over the keyword and drag it to the blank page of the test step to add a test step as a keyword.
  • Click any area of the test keyword to edit the keyword pair application case details.
  • Click to view the information about the key word.
  • Click to disable a keyword, and click it again to enable the keyword.
  • Click to delete the keyword from the test procedure.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback