在机器人框架中记录 HTML 请求

Logging HTML requests in robot framework(在机器人框架中记录 HTML 请求)
本文介绍了在机器人框架中记录 HTML 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力寻找与此相关的大量信息,所以我转向这里寻求帮助.

I have been struggling to find much information to go along with this so I have turned here for help.

我正在使用机器人框架运行 Web 应用程序的 UI 测试.当测试失败时,我想要一个 HTML 请求的日志,这样我就可以回顾一下失败的原因,即未加载的内容、500 个错误等.

I am running UI tests of a web app using robot framework. When a test fails I want a log of the HTML requests so I can look back and see what failed, i.e. things not loading, 500 errors etc.

到目前为止,我还没有设法在机器人框架或 selenium 中找到一些东西?

To this point I haven't managed to find something within the robot framework or selenium?

另一种选择是查看是否有用于记录此类事情的 python 库,或者创建一个是否是一项合理的任务?

Another option is to see if there is a python library for logging this sort of thing or whether it would be a reasonable task to create one?

我也研究过使用 autoit,它使用浏览器的内部网络日志工具,但使用这些工具本身就是一个完整的测试,我不确定它的效果如何.我确定我一定不是第一个想要这个功能的人吗?

I have also looked into using autoit it use the browsers internal network logging tools but using these is a whole test of its own and I am not sure how well it would work. I am sure I must not be the first person to want this functionality?

我一直在研究这个问题,发现一个可行的选择可能是使用 pcapy 的数据包嗅探器,我不知道在网络编程中该做什么以及如何处理数据包以仅获取帖子并获取数据包和响应,任何帮助将不胜感激

I have continued to look into this and have found a viable option may be a packet sniffer using pcapy, I have no idea what to do in network programming and how I would proccess packets to only get post and get packets and repsonses, any help would be much appreciated

干杯

推荐答案

Selenium 只是模拟用户行为,所以在这里对您没有帮助.您可以使用记录所有流量并让您检查流量的代理.BrowserMob 代理 让你这样做.有关如何为你的浏览器.

Selenium is only emulating user behaviour, so it does not help you here. You could use a proxy that logs all the traffic and lets you examine the traffic. BrowserMob Proxy let's you do that. See Create Webdriver from Selenium2Libray on how to configure proxy for your browser.

这样,您可以在发现测试失败后要求您的代理返回流量.

This way you can ask your proxy to return the traffic after you noticed a failure in you test.

这篇关于在机器人框架中记录 HTML 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Leetcode 234: Palindrome LinkedList(Leetcode 234:回文链接列表)
How do I read an Excel file directly from Dropbox#39;s API using pandas.read_excel()?(如何使用PANDAS.READ_EXCEL()直接从Dropbox的API读取Excel文件?)
subprocess.Popen tries to write to nonexistent pipe(子进程。打开尝试写入不存在的管道)
I want to realize Popen-code from Windows to Linux:(我想实现从Windows到Linux的POpen-code:)
Reading stdout from a subprocess in real time(实时读取子进程中的标准输出)
How to call type safely on a random file in Python?(如何在Python中安全地调用随机文件上的类型?)