在机器人框架中记录HTML请求 [英] Logging HTML requests in robot framework

查看:124
本文介绍了在机器人框架中记录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.

到目前为止,我还没有在机器人框架或硒中找到任何东西?

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代理,您可以执行此操作.有关如何为Selenium2Libray配置代理的信息,请参见创建Webdriver .您的浏览器.

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请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆