web测试:test过程中接口报错 "Object reference not set to an instance of an object."
"Object reference not set to an instance of an object."
对象引用未设置为对象的实例
可能原因:
1、参数类型传错,或少传参数;
2、前端业务需设置必填值,接口未获取到必填值;
3、接口内部报错;(计算报错,逻辑出错)
比如,一个供应商资料接口,/api/services/app/ContactSupplierManagement/Create
文档会给你所有参数名,及参数类型;

| ouId | integer($int32)
[必须]-所属组织单元 ID |
| ouId_OuName | string
所属组织:关联值_________________________________ |
| contactCode | string
供应商编码 |
| contactName | string
供应商名称 |
| contactFullName | string
供应商全称 |
| supplierTypeid | integer($int32)
供应商类型 |
| contactTypeIdTValue | string
供应商类型:字典值___________________________ |
| supplierClassid | integer($int32)
供应商分类 ID |
| contactClassId_ClassName | string
供应商分类:关联值_______________ |
| contactWorkPropertyId | [...] |
| contactWorkPropertyIdTValue | string
供应商性质:字典值_____________ |
| status | integer($int32)
状态 |
| statusTValue | string
状态:字典值 |
| paymentTermId | integer($int32)
付款条件Id |
| priceMode | integer($int32)
取价方式 |
| taxComputationMode | integer($int32)
计税方式 |
| amountComputationMode | integer($int32)
计算方式 |
| ficaOuId | integer($int32)
财务组织单元 ID |
| ficaOuId_OuName | string
对应财务组织:关联值 |
| mnemonic | string
助记码 |
| supplierGradeid | integer($int32)
供应商等级 ID |
| contactGradeIdName | string
供应商等级值 |
| isSupplier | integer($int32)
是否供应商 |
| isCustomer | integer($int32)
是否客户 |
| taxCode | string maxLength: 50 minLength: 0 纳税登记号 |
| opAreaId | integer($int32)
业务地区 |
| opAreaId_AreaName | string
业务地区:关联值 |
| adAreaId | integer($int32)
行政地区 |
| adAreaId_AreaName | string
TaxCode |
| legalPerson | string maxLength: 50 minLength: 0 法人代表 |
| regAddress | string maxLength: 200 minLength: 0 注册地址 |
| manager | string maxLength: 50 minLength: 0 负责人 |
| phone | string maxLength: 50 minLength: 0 电话 |
| remark | string maxLength: 200 minLength: 0 备注 |
| creditMgt | boolean
信用管理 |
| id | integer($int32) |
| taxRate | number($double)
税率 |
| pirceDecimal | integer($int32)
结算价小数位数 |
| amountDecimal | integer($int32)
结算金额小数位数 |
实际调用时的参数:

{
"ouId":1627,
"contactCode":"3",
"contactName":"2",
"contactFullName":"22",
"supplierTypeid":0,
"supplierClassid":"",
"contactWorkPropertyId":[
0
],
"status":1,
"ficaOuId":"",
"mnemonic":"",
"supplierGradeid":0,
"isSupplier":1,
"isCustomer":0,
"taxCode":"",
"opAreaId":1674,
"adAreaId":"",
"legalPerson":"",
"regAddress":"",
"manager":"",
"phone":"",
"remark":"",
"creditMgt":true,
"id":0,
"contactBanks_ChildTable":[
],
"contactAddress_ChildTable":[
],
"contactOu_ChildTable":[
],
"paymentTermId":"",
"priceMode":"",
"taxComputationMode":"",
"amountComputationMode":"",
"pirceDecimal":2,
"amountDecimal":2
}
报错原因: integer类型,传入了String类型,后端没有对类型做管控。空String传过去就会报错。

·
web测试:test过程中接口报错 "Object reference not set to an instance of an object."的更多相关文章
- MySQL使用过程中的报错处理(持续更新)
一.数据库初始化 1.Percona的MySQL 5.6.20版本数据库初始化 初始化命令(MySQL 5.6版本不适用mysqld命令进行初始化) ./scripts/mysql_install_d ...
- jmeter测试文件上传接口报错:connection reset by peer: socket write error
最近在对文件上传接口性能测试时,设置150线程数并发时,总会出现以下错误:connection reset by peer: socket write error 在网上搜索了一下,得到的原因有这些: ...
- PXE+kickstart网络安装CentOS7.4系统及过程中各种报错
环境:关闭防火墙.selinux 注意:虚拟机进行网络安装的话,7.3以后的系统是需要2G以上的内存 [root@kickstart ~]# cat /etc/redhat-release CentO ...
- 解决 Composer-Setup.exe 安装过程中的报错
问题 在 Windows 7 执行 Composer-Setup.exe 以安装 Composer 过程中 上图中点击[Next]时,出现如下报错信息 原因分析 由上述提示信息,可推测两方面原因: 1 ...
- kolla制作过程中:neutron-sfc-agent 报错的问题
在使用二进制方式编译镜像的时候,neutron的sfc-agent提示如下错误ERROR:kolla.image.build:neutron-sfc-agent Failed with status: ...
- Jenkins在H5编译加密过程中一个报错
################################ 背景:开发环境在编译H5的时候出现了以下报错,记录下 ################################ D:\Jenk ...
- SpringBoot环境下使用测试类注入Mapper接口报错解决
当我们在进行开发中难免会要用到测试类,而且测试类要注入Mapper接口,如果测试运行的时候包空指针异常,看看测试类上面的注解是否用对! 正常测试我们需要用到的注解有这些: @SpringBootTes ...
- docker 1.13.1 启动容器过程中mount报错
docker 1.13.1 启动container 问题 [root@openfalcon_transfer1 harbor]# docker run -it --name test busybox ...
- MongoDB使用过程中的报错处理(持续更新)
1.连接池问题 com.mongodb.DBPortPool$SemaphoresOut Concurrent requests for database connection have exceed ...
- asp.net使用wsdl文件调用接口,以及调用SSL接口报错“根据验证过程 远程证书无效”的处理
1.调用wsdl接口,首先需要将wsdl文件转换为cs文件: 进入VS 开发人员命令提示行,输入如下命令: c:/Program Files/Microsoft Visual Studio 8/VC& ...
随机推荐
- css animation 复刻
今天做了一个七巧板的小页面,发现对于css动画一些内容又有了新的认识,所以以下准备复习一遍 首先一共有以下属性 @keyframes 如果您在 @keyframes 规则中指定了 CSS 样式,动画将 ...
- [Swift]使用Alamofire传递参数时报错
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1) } span.s1 { font-variant-ligatures: no-c ...
- Windows10下SecureCRT、SecureFX安装与破解(超级详细)
整理了Windows10下最新版本SecureCRT9.1.SecureFX9.1安装 1.资源地址: 链接:https://pan.baidu.com/s/1XoQqpRlpBm6Tvc0fHni6 ...
- python peewee
from peewee import MySQLDatabase, Model from peewee import CharField, IntegerField, BooleanField # 引 ...
- 树莓派,脚本遍历当前目录下视频文件,并用omxplayer播放
事先准备好视频文件,文件名内包含视频尺寸信息,以方便构造 --win "x1 y1 x2 y2" 字符串. 通过 omxplayer -i filename 可查看视频尺寸 ...
- MyBatis_04(MyBatis获取“参数值”的两种方式)
MyBatis获取"参数值"的两种方式 (重点!!!) MyBatis获取参数值的两种方式:${}和#{} ${}的本质就是字符串拼接 , #{}的本质就是占位符赋值 ${}使用字 ...
- mysql常用语句操作
概述: 1.通过表结构介绍.来操作mysql常用的语法&语句: 2.现在学习下几个基本的sql语句,万变不离其宗,把基础弄扎实了其它的就很容易了 一.表结构&建表: 1.学生基础信息表 ...
- python34
Python成员运算符 除了以上的一些运算符之外,Python还支持成员运算符,测试实例中包含了一系列的成员,包括字符串,列表或元组. 运算符 描述 实例 in 如果在指定的序列中找到值返回 True ...
- NDK 减少 so 库体积方法总结
. 使用 strip 使用 NDK toolchain 可以把调试的 C++ 符号表(Symbol Table)中数据删除,我们一般我们打成 APK 会自动帮我们做这个工作,当然也可以手动设置: 手动 ...
- Hyperledger fabric 续篇
前面我们如果进行顺利的话,环境已经可以成功运行,并且前端页面也可以正常显示,为自己鼓掌吧!!! 接下来,其实也是我自己想做一下尝试,还记得前面的一条查询车辆情况的指令吗? peer chaincode ...