Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改两个小问题 #1099

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

修改两个小问题 #1099

wants to merge 3 commits into from

Conversation

xiongjs
Copy link

@xiongjs xiongjs commented Jul 15, 2021

1、修改全局变量覆盖局部变量的问题;(比如定义了某个全局变量A,某条用例在config.variables中又定义了变量A,在该条用例中应该使用局部变量。提出修改的原因是extract输出的变量是全局的,很容易和别的用例的自定义变量重名)
2、解决断言时,不能从list末尾开始取值的问题;(不支持-1的问题,如list.-1)

断言时,支持从列表最后开始取值,如list[-1]
@xiongjs
Copy link
Author

xiongjs commented Jul 26, 2021

并没有人理我

@wangtesting
Copy link

并没有人理我

原来已经修复了啊。。这两个还都用到过,
大佬求解下,
1、如何能让提取的值给所有case用呢,只能通过读写外部文件了吗(全局变量) 蛮多场景需要的啊
2、集成到ci,能不能传值到debugtalk.py里面呢。。切环境时候.Env不能解决所有场景
3、报错:'latin-1' codec can't encode characters in position 12-14: Body , 抓包人家是username&password,我用date请求传参方式,就报错这个。。不知道在框架里怎么改 .
希望大佬能看见吧,闲逛正好看见了
httprunenr 2.2.2 python3.6

@xiongjs
Copy link
Author

xiongjs commented Aug 28, 2021

并没有人理我

原来已经修复了啊。。这两个还都用到过,
大佬求解下,
1、如何能让提取的值给所有case用呢,只能通过读写外部文件了吗(全局变量) 蛮多场景需要的啊
2、集成到ci,能不能传值到debugtalk.py里面呢。。切环境时候.Env不能解决所有场景
3、报错:'latin-1' codec can't encode characters in position 12-14: Body , 抓包人家是username&password,我用date请求传参方式,就报错这个。。不知道在框架里怎么改 .
希望大佬能看见吧,闲逛正好看见了
httprunenr 2.2.2 python3.6

1、使用“extract”关键词取到的变量,在本次批量执行的用例中是全局的(3.x才行)。也可以写个teardown方法取到这个值,取到的值怎么给全局就和python怎么定义全局变量类似,方法有很多,实在不行存到某个实体配置文件中也行。
2、没看明白具体问题是什么,我用过两种切环境的方法:a. 执行的时候debugtalk去读取某个配置文件,动态获取base_url和登录账号信息;b. 直接生成多个环境的用例,想执行哪个环境调用接口就行(我是用excel写用例,然后转换成httprunner用例)
3、没碰到过这个,可能是3.x没有这个问题。字符编码问题吧,调试找一下,我也不知道具体在哪出了问题。

@debugtalk debugtalk force-pushed the master branch 2 times, most recently from e9aa51a to 3e404da Compare April 8, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants