简体   繁体   English

如何获取截图然后点击selenium中保存的截图?

[英]How to take screenshot and then click on that saved screenshot in selenium?

I am unable to click on button on page so I am taking screenshot and trying to click on that screenshot. 我无法单击页面上的按钮,因此我正在截取屏幕截图并尝试单击该屏幕截图。 I need code to take screenshot of particular element and click on that element through code. 我需要代码来获取特定元素的屏幕截图,然后通过代码单击该元素。

Selenium仅用于自动化Web应用程序,您无法在Web应用程序之外执行任何操作。

Try to use Extent report tool for selenium. 尝试使用硒的范围报告工具。 If your test fails(Or any condition you set), It call method for taking screenshot and save it to extent report. 如果您的测试失败(或者您设置的任何条件),它会调用截取屏幕并将其保存到范围报告的方法。 At the end of the test, open extent report html file. 在测试结束时,打开范围报告html文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM