Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
829 views
by Contributing Tester (24 points)
when we are taking screesnhot its capturing only dom page.its not including url

i want a code which should capture url in screenshot using selenium python only not java bcs i found the code in java already but i need it in python .could anyone please help me to do this.

1 Answer

1 like 0 dislike
by
Screenshots are actually taken using JavaScript nowadays. So, it will just capture the page rendered using HTML. It will not be able to capture the URL.

You can extend take screenshot method and get the URL of the page by using

driver.getURL()

Once, you receive the URL, you can simply add it to your screenshot image manually.

Let us know your views.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...