I understand that the screenshot functionality basically works as painting the DOM. Since the URL is not part of the DOM, the screenshot does not contain the URL. But is there any workaround to capture the URL as part of the screenshot?
相关问题
- Selenium in Java is not finding element when using
- How to send text to the search field through Selen
- What is the difference in “find_element_by_xpath”
- WebElement.getText() function and utf8
- Using python selenium for Microsoft edge
相关文章
- selenium的webdriver可以实现验证页面中,异步请求状态码的操作吗?
- driver.Manage().Logs.GetLog(LogType.Browser) no lo
- Chrome: fake microphone input for test purpose
- Speeding up Selenium Webdriver
- Python Selenium Send Keys Giving Warning about siz
- Selenium C# Webdriver How to detect if element is
- How to Fix this C# issue No test matches the given
- Send keys not to element but in general selenium
Absolutely correct, getting URL in the screen-shot is yet not possible in Selenium and here are the reference Link which tells the same. But as a part of workaround what i can suggest you is to first get the screen shot using
Remember this workaround might became time consuming if more number of screen shots has to be taken but can be efficient if you want only one screen shot in single run of your AUT. Second once you copy the screen shot in your clipboard it again depends on you how you want to automate it further, By using Third party tool like Sikuli you can easily integrate it with selenium.
As this is a workaround i would not guarantee success.
Currently it is not possible with webdriver.
You can follow any of the below approaches. (You did not mention the programming language. These examples are in Java.)
1. Capture current desktop screen
Robot has createScreenCapture method. So, I would go with that & It is very easy to implement.
2. You can write the URL in the image.
This might be an annoying approach sometimes as it might hide information in the image. But this too is very easy to implement.
Check this answer
3. Add the current URL to the image as meta data
Check this answer