Issue in taking screenshot in selenium while using chromedriver 73 for chrome version 73Timed out receiving message from renderer: 10.000 while capturing screenshot using chromedriver and chrome through Jenkins on WindowsGetting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service modeHow to programmatically take a screenshot on Android?How to take screenshot with Selenium WebDriverUsing HTML5/Canvas/JavaScript to take in-browser screenshotsSelenium with Chromedriver: mimicking page_load_timeoutnot sure if versions of chromium & chromedriver stable for SeleniumCan a website detect when you are using selenium with chromedriver?Error while trying to open chrome python-seleniumHow to pass cookies to local html file while rendering the file through selenium?Way to change Google Chrome user agent in Selenium?python selenium not running with chrome driver & chrome version

QGIS Linestring rendering curves between vertex

P-MOSFET failing

As a DM, how to avoid unconscious metagaming when dealing with a high AC character?

Why does the autopilot disengage even when it does not receive pilot input?

To accent or not to accent in Greek

What is this welding tool I found in my attic?

Do native speakers use ZVE or CPU?

Why would an Inquisitive rogue choose to use Insightful Fighting as opposed to using their Cunning Action to Hide?

CPU overheating in Ubuntu 18.04

Does Google Maps take into account hills/inclines for route times?

Why does Hellboy file down his horns?

How does one stock fund's charge of 1% more in operating expenses than another fund lower expected returns by 10%?

Can anybody provide any information about this equation?

What are some symbols representing peasants/oppressed persons fighting back?

Can I intentionally omit previous work experience or pretend it doesn't exist when applying for jobs?

Why does java.time.Period#normalized() not normalize days?

Fix /dev/sdb after using dd with no device inserted

Filtering fine silt/mud from water (not necessarily bacteria etc.)

Are there any double stars that I can actually see orbit each other?

What does `[$'rn']` mean?

Can I call 112 to check a police officer's identity in the Czech Republic?

Doing research in academia and not liking competition

Why did the Japanese attack the Aleutians at the same time as Midway?

Why hasn't the U.S. government paid war reparations to any country it attacked?



Issue in taking screenshot in selenium while using chromedriver 73 for chrome version 73


Timed out receiving message from renderer: 10.000 while capturing screenshot using chromedriver and chrome through Jenkins on WindowsGetting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service modeHow to programmatically take a screenshot on Android?How to take screenshot with Selenium WebDriverUsing HTML5/Canvas/JavaScript to take in-browser screenshotsSelenium with Chromedriver: mimicking page_load_timeoutnot sure if versions of chromium & chromedriver stable for SeleniumCan a website detect when you are using selenium with chromedriver?Error while trying to open chrome python-seleniumHow to pass cookies to local html file while rendering the file through selenium?Way to change Google Chrome user agent in Selenium?python selenium not running with chrome driver & chrome version






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















When i tried to take screenshot of a webpage using selenium in python, i get error message selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from renderer: 10.000.



Code:



from selenium import webdriver
from selenium.webdriver.chrome.options import Options
indi_url = 'http://www.google.com'
options = Options()
options.add_argument("disable-infobars")
options.add_argument("--start-maximized")
options.add_argument("--disable-popup-blocking")
options.add_argument("disable-popup-blocking")
options.add_argument("--disable")
driver = webdriver.Chrome(options=options)
driver.get(indi_url)
driver.implicitly_wait(30)
driver.save_screenshot("new.png")


Error message:



Screenshot of error message



I'm using Chrome version 73, chromedriver version 73.



Note: code was working fine (ie.screenshot)in lower version of chrome and chrome driver.



Help me out in fixing this issue for new version of chrome driver.



Thanks in advance










share|improve this question
























  • Update the question with your code trials

    – DebanjanB
    Mar 26 at 5:49






  • 2





    It's a known issue, You can see in the following bugs reports groups.google.com/forum/#!topic/chromedriver-users/ZBEju24L5ww bugs.chromium.org/p/chromium/issues/detail?id=942023

    – Ryan Bowden
    Mar 26 at 7:46











  • @DebanjanB, updated question with code.

    – Yakeshraj M
    Mar 27 at 1:35











  • @Ryan Bowden, Any workaround for this?

    – Yakeshraj M
    Mar 27 at 1:36











  • @YakeshrajM Are you using Jenkins or any scheduler?

    – DebanjanB
    Mar 27 at 5:44

















2















When i tried to take screenshot of a webpage using selenium in python, i get error message selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from renderer: 10.000.



Code:



from selenium import webdriver
from selenium.webdriver.chrome.options import Options
indi_url = 'http://www.google.com'
options = Options()
options.add_argument("disable-infobars")
options.add_argument("--start-maximized")
options.add_argument("--disable-popup-blocking")
options.add_argument("disable-popup-blocking")
options.add_argument("--disable")
driver = webdriver.Chrome(options=options)
driver.get(indi_url)
driver.implicitly_wait(30)
driver.save_screenshot("new.png")


Error message:



Screenshot of error message



I'm using Chrome version 73, chromedriver version 73.



Note: code was working fine (ie.screenshot)in lower version of chrome and chrome driver.



Help me out in fixing this issue for new version of chrome driver.



Thanks in advance










share|improve this question
























  • Update the question with your code trials

    – DebanjanB
    Mar 26 at 5:49






  • 2





    It's a known issue, You can see in the following bugs reports groups.google.com/forum/#!topic/chromedriver-users/ZBEju24L5ww bugs.chromium.org/p/chromium/issues/detail?id=942023

    – Ryan Bowden
    Mar 26 at 7:46











  • @DebanjanB, updated question with code.

    – Yakeshraj M
    Mar 27 at 1:35











  • @Ryan Bowden, Any workaround for this?

    – Yakeshraj M
    Mar 27 at 1:36











  • @YakeshrajM Are you using Jenkins or any scheduler?

    – DebanjanB
    Mar 27 at 5:44













2












2








2








When i tried to take screenshot of a webpage using selenium in python, i get error message selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from renderer: 10.000.



Code:



from selenium import webdriver
from selenium.webdriver.chrome.options import Options
indi_url = 'http://www.google.com'
options = Options()
options.add_argument("disable-infobars")
options.add_argument("--start-maximized")
options.add_argument("--disable-popup-blocking")
options.add_argument("disable-popup-blocking")
options.add_argument("--disable")
driver = webdriver.Chrome(options=options)
driver.get(indi_url)
driver.implicitly_wait(30)
driver.save_screenshot("new.png")


Error message:



Screenshot of error message



I'm using Chrome version 73, chromedriver version 73.



Note: code was working fine (ie.screenshot)in lower version of chrome and chrome driver.



Help me out in fixing this issue for new version of chrome driver.



Thanks in advance










share|improve this question
















When i tried to take screenshot of a webpage using selenium in python, i get error message selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from renderer: 10.000.



Code:



from selenium import webdriver
from selenium.webdriver.chrome.options import Options
indi_url = 'http://www.google.com'
options = Options()
options.add_argument("disable-infobars")
options.add_argument("--start-maximized")
options.add_argument("--disable-popup-blocking")
options.add_argument("disable-popup-blocking")
options.add_argument("--disable")
driver = webdriver.Chrome(options=options)
driver.get(indi_url)
driver.implicitly_wait(30)
driver.save_screenshot("new.png")


Error message:



Screenshot of error message



I'm using Chrome version 73, chromedriver version 73.



Note: code was working fine (ie.screenshot)in lower version of chrome and chrome driver.



Help me out in fixing this issue for new version of chrome driver.



Thanks in advance







selenium google-chrome selenium-webdriver selenium-chromedriver screenshot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 29 at 4:26







Yakeshraj M

















asked Mar 26 at 5:45









Yakeshraj MYakeshraj M

112 bronze badges




112 bronze badges












  • Update the question with your code trials

    – DebanjanB
    Mar 26 at 5:49






  • 2





    It's a known issue, You can see in the following bugs reports groups.google.com/forum/#!topic/chromedriver-users/ZBEju24L5ww bugs.chromium.org/p/chromium/issues/detail?id=942023

    – Ryan Bowden
    Mar 26 at 7:46











  • @DebanjanB, updated question with code.

    – Yakeshraj M
    Mar 27 at 1:35











  • @Ryan Bowden, Any workaround for this?

    – Yakeshraj M
    Mar 27 at 1:36











  • @YakeshrajM Are you using Jenkins or any scheduler?

    – DebanjanB
    Mar 27 at 5:44

















  • Update the question with your code trials

    – DebanjanB
    Mar 26 at 5:49






  • 2





    It's a known issue, You can see in the following bugs reports groups.google.com/forum/#!topic/chromedriver-users/ZBEju24L5ww bugs.chromium.org/p/chromium/issues/detail?id=942023

    – Ryan Bowden
    Mar 26 at 7:46











  • @DebanjanB, updated question with code.

    – Yakeshraj M
    Mar 27 at 1:35











  • @Ryan Bowden, Any workaround for this?

    – Yakeshraj M
    Mar 27 at 1:36











  • @YakeshrajM Are you using Jenkins or any scheduler?

    – DebanjanB
    Mar 27 at 5:44
















Update the question with your code trials

– DebanjanB
Mar 26 at 5:49





Update the question with your code trials

– DebanjanB
Mar 26 at 5:49




2




2





It's a known issue, You can see in the following bugs reports groups.google.com/forum/#!topic/chromedriver-users/ZBEju24L5ww bugs.chromium.org/p/chromium/issues/detail?id=942023

– Ryan Bowden
Mar 26 at 7:46





It's a known issue, You can see in the following bugs reports groups.google.com/forum/#!topic/chromedriver-users/ZBEju24L5ww bugs.chromium.org/p/chromium/issues/detail?id=942023

– Ryan Bowden
Mar 26 at 7:46













@DebanjanB, updated question with code.

– Yakeshraj M
Mar 27 at 1:35





@DebanjanB, updated question with code.

– Yakeshraj M
Mar 27 at 1:35













@Ryan Bowden, Any workaround for this?

– Yakeshraj M
Mar 27 at 1:36





@Ryan Bowden, Any workaround for this?

– Yakeshraj M
Mar 27 at 1:36













@YakeshrajM Are you using Jenkins or any scheduler?

– DebanjanB
Mar 27 at 5:44





@YakeshrajM Are you using Jenkins or any scheduler?

– DebanjanB
Mar 27 at 5:44












2 Answers
2






active

oldest

votes


















0














As the error shows, your filename for screenshot does not match the template extensions .png



Here is an example how to make a screenshot.



Java:



File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(".\Screenshots\example_screenshot.png"));


Python:



driver.save_screenshot("screenshot.png")





share|improve this answer

























  • OP is using Python possibly you have to refactor the Java code into Python.

    – DebanjanB
    Mar 26 at 7:49











  • @Infern0 that won't be the issue, i guess because i have tried the same before, it worked fine before. And getting the same error msg using "driver.screenshot("screenshot.png")"

    – Yakeshraj M
    Mar 27 at 1:37



















-1














This error message...



 UserWarning: name used for saved screenshot does not match file type. It should end with a .png extension
"type. It should end with a .png extension", UserWarning)


...implies that the Selenium-Python client encountered an issue while invoking get_screenshot_as_file() method.




get_screenshot_as_file()



get_screenshot_as_file() saves a screenshot of the current window to a PNG image file. Returns False if there is any IOError, else returns True. Use full paths in your filename.



  • Args:

    • filename: The full path you wish to save your screenshot to. This should end with a .png extension.



  • Usage:



    driver.get_screenshot_as_file('/Screenshots/foo.png')



  • Defination:



    if not filename.lower().endswith('.png'):
    warnings.warn("name used for saved screenshot does not match file "
    "type. It should end with a `.png` extension", UserWarning)
    png = self.get_screenshot_as_png()
    try:
    with open(filename, 'wb') as f:
    f.write(png)
    except IOError:
    return False
    finally:
    del png
    return True



Analysis



As per the snapshot of the error stack trace:



snapshot



You have used the command as:



driver.get_screenshot_as_file('new.jpeg')


The issues were:



  • The filename didn't end with .png

  • The desired full path of your filename wasn't provided.

Even if you desire to use save_screenshot() this method in-turn invokes get_screenshot_as_file(filename)




Solution



Create a directory within your project as Screenshots and provide the absolute path of the filename you desire for the screenshot while invoking either of the methods as follows:



  • driver.get_screenshot_as_file("./Screenshots/YakeshrajM.png")

  • driver.save_screenshot("./Screenshots/YakeshrajM.png")


Update



Currently GAed Chrome v73 have some issues and you may like to downgrade to Chrome v72. You can find a couple of relevant discussions in:



  • Getting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service mode

  • Timed out receiving message from renderer: 10.000 while capturing screenshot using chromedriver and chrome through Jenkins on Windows





share|improve this answer

























  • @YakeshrajM Did you get a chance to look into this solution?

    – DebanjanB
    Mar 29 at 4:41











  • facing same issue still.. As i already mentioned that code was working good with previous version of chrome and chrome driver and i was able to save the screenshots in '.jpg' format itself.. '.png' extension is just user warning message, which can be neglible. As already told by Ryan Bowden it is an open issue in chrome and they are trying to fix it. So waiting for the fix eagerly.

    – Yakeshraj M
    Mar 30 at 16:59











  • @YakeshrajM Checkout the answer update and let me know the status.

    – DebanjanB
    Mar 30 at 17:01













Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55350547%2fissue-in-taking-screenshot-in-selenium-while-using-chromedriver-73-for-chrome-ve%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














As the error shows, your filename for screenshot does not match the template extensions .png



Here is an example how to make a screenshot.



Java:



File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(".\Screenshots\example_screenshot.png"));


Python:



driver.save_screenshot("screenshot.png")





share|improve this answer

























  • OP is using Python possibly you have to refactor the Java code into Python.

    – DebanjanB
    Mar 26 at 7:49











  • @Infern0 that won't be the issue, i guess because i have tried the same before, it worked fine before. And getting the same error msg using "driver.screenshot("screenshot.png")"

    – Yakeshraj M
    Mar 27 at 1:37
















0














As the error shows, your filename for screenshot does not match the template extensions .png



Here is an example how to make a screenshot.



Java:



File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(".\Screenshots\example_screenshot.png"));


Python:



driver.save_screenshot("screenshot.png")





share|improve this answer

























  • OP is using Python possibly you have to refactor the Java code into Python.

    – DebanjanB
    Mar 26 at 7:49











  • @Infern0 that won't be the issue, i guess because i have tried the same before, it worked fine before. And getting the same error msg using "driver.screenshot("screenshot.png")"

    – Yakeshraj M
    Mar 27 at 1:37














0












0








0







As the error shows, your filename for screenshot does not match the template extensions .png



Here is an example how to make a screenshot.



Java:



File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(".\Screenshots\example_screenshot.png"));


Python:



driver.save_screenshot("screenshot.png")





share|improve this answer















As the error shows, your filename for screenshot does not match the template extensions .png



Here is an example how to make a screenshot.



Java:



File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File(".\Screenshots\example_screenshot.png"));


Python:



driver.save_screenshot("screenshot.png")






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 26 at 8:42

























answered Mar 26 at 7:06









Infern0Infern0

1,3811 gold badge3 silver badges14 bronze badges




1,3811 gold badge3 silver badges14 bronze badges












  • OP is using Python possibly you have to refactor the Java code into Python.

    – DebanjanB
    Mar 26 at 7:49











  • @Infern0 that won't be the issue, i guess because i have tried the same before, it worked fine before. And getting the same error msg using "driver.screenshot("screenshot.png")"

    – Yakeshraj M
    Mar 27 at 1:37


















  • OP is using Python possibly you have to refactor the Java code into Python.

    – DebanjanB
    Mar 26 at 7:49











  • @Infern0 that won't be the issue, i guess because i have tried the same before, it worked fine before. And getting the same error msg using "driver.screenshot("screenshot.png")"

    – Yakeshraj M
    Mar 27 at 1:37

















OP is using Python possibly you have to refactor the Java code into Python.

– DebanjanB
Mar 26 at 7:49





OP is using Python possibly you have to refactor the Java code into Python.

– DebanjanB
Mar 26 at 7:49













@Infern0 that won't be the issue, i guess because i have tried the same before, it worked fine before. And getting the same error msg using "driver.screenshot("screenshot.png")"

– Yakeshraj M
Mar 27 at 1:37






@Infern0 that won't be the issue, i guess because i have tried the same before, it worked fine before. And getting the same error msg using "driver.screenshot("screenshot.png")"

– Yakeshraj M
Mar 27 at 1:37














-1














This error message...



 UserWarning: name used for saved screenshot does not match file type. It should end with a .png extension
"type. It should end with a .png extension", UserWarning)


...implies that the Selenium-Python client encountered an issue while invoking get_screenshot_as_file() method.




get_screenshot_as_file()



get_screenshot_as_file() saves a screenshot of the current window to a PNG image file. Returns False if there is any IOError, else returns True. Use full paths in your filename.



  • Args:

    • filename: The full path you wish to save your screenshot to. This should end with a .png extension.



  • Usage:



    driver.get_screenshot_as_file('/Screenshots/foo.png')



  • Defination:



    if not filename.lower().endswith('.png'):
    warnings.warn("name used for saved screenshot does not match file "
    "type. It should end with a `.png` extension", UserWarning)
    png = self.get_screenshot_as_png()
    try:
    with open(filename, 'wb') as f:
    f.write(png)
    except IOError:
    return False
    finally:
    del png
    return True



Analysis



As per the snapshot of the error stack trace:



snapshot



You have used the command as:



driver.get_screenshot_as_file('new.jpeg')


The issues were:



  • The filename didn't end with .png

  • The desired full path of your filename wasn't provided.

Even if you desire to use save_screenshot() this method in-turn invokes get_screenshot_as_file(filename)




Solution



Create a directory within your project as Screenshots and provide the absolute path of the filename you desire for the screenshot while invoking either of the methods as follows:



  • driver.get_screenshot_as_file("./Screenshots/YakeshrajM.png")

  • driver.save_screenshot("./Screenshots/YakeshrajM.png")


Update



Currently GAed Chrome v73 have some issues and you may like to downgrade to Chrome v72. You can find a couple of relevant discussions in:



  • Getting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service mode

  • Timed out receiving message from renderer: 10.000 while capturing screenshot using chromedriver and chrome through Jenkins on Windows





share|improve this answer

























  • @YakeshrajM Did you get a chance to look into this solution?

    – DebanjanB
    Mar 29 at 4:41











  • facing same issue still.. As i already mentioned that code was working good with previous version of chrome and chrome driver and i was able to save the screenshots in '.jpg' format itself.. '.png' extension is just user warning message, which can be neglible. As already told by Ryan Bowden it is an open issue in chrome and they are trying to fix it. So waiting for the fix eagerly.

    – Yakeshraj M
    Mar 30 at 16:59











  • @YakeshrajM Checkout the answer update and let me know the status.

    – DebanjanB
    Mar 30 at 17:01















-1














This error message...



 UserWarning: name used for saved screenshot does not match file type. It should end with a .png extension
"type. It should end with a .png extension", UserWarning)


...implies that the Selenium-Python client encountered an issue while invoking get_screenshot_as_file() method.




get_screenshot_as_file()



get_screenshot_as_file() saves a screenshot of the current window to a PNG image file. Returns False if there is any IOError, else returns True. Use full paths in your filename.



  • Args:

    • filename: The full path you wish to save your screenshot to. This should end with a .png extension.



  • Usage:



    driver.get_screenshot_as_file('/Screenshots/foo.png')



  • Defination:



    if not filename.lower().endswith('.png'):
    warnings.warn("name used for saved screenshot does not match file "
    "type. It should end with a `.png` extension", UserWarning)
    png = self.get_screenshot_as_png()
    try:
    with open(filename, 'wb') as f:
    f.write(png)
    except IOError:
    return False
    finally:
    del png
    return True



Analysis



As per the snapshot of the error stack trace:



snapshot



You have used the command as:



driver.get_screenshot_as_file('new.jpeg')


The issues were:



  • The filename didn't end with .png

  • The desired full path of your filename wasn't provided.

Even if you desire to use save_screenshot() this method in-turn invokes get_screenshot_as_file(filename)




Solution



Create a directory within your project as Screenshots and provide the absolute path of the filename you desire for the screenshot while invoking either of the methods as follows:



  • driver.get_screenshot_as_file("./Screenshots/YakeshrajM.png")

  • driver.save_screenshot("./Screenshots/YakeshrajM.png")


Update



Currently GAed Chrome v73 have some issues and you may like to downgrade to Chrome v72. You can find a couple of relevant discussions in:



  • Getting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service mode

  • Timed out receiving message from renderer: 10.000 while capturing screenshot using chromedriver and chrome through Jenkins on Windows





share|improve this answer

























  • @YakeshrajM Did you get a chance to look into this solution?

    – DebanjanB
    Mar 29 at 4:41











  • facing same issue still.. As i already mentioned that code was working good with previous version of chrome and chrome driver and i was able to save the screenshots in '.jpg' format itself.. '.png' extension is just user warning message, which can be neglible. As already told by Ryan Bowden it is an open issue in chrome and they are trying to fix it. So waiting for the fix eagerly.

    – Yakeshraj M
    Mar 30 at 16:59











  • @YakeshrajM Checkout the answer update and let me know the status.

    – DebanjanB
    Mar 30 at 17:01













-1












-1








-1







This error message...



 UserWarning: name used for saved screenshot does not match file type. It should end with a .png extension
"type. It should end with a .png extension", UserWarning)


...implies that the Selenium-Python client encountered an issue while invoking get_screenshot_as_file() method.




get_screenshot_as_file()



get_screenshot_as_file() saves a screenshot of the current window to a PNG image file. Returns False if there is any IOError, else returns True. Use full paths in your filename.



  • Args:

    • filename: The full path you wish to save your screenshot to. This should end with a .png extension.



  • Usage:



    driver.get_screenshot_as_file('/Screenshots/foo.png')



  • Defination:



    if not filename.lower().endswith('.png'):
    warnings.warn("name used for saved screenshot does not match file "
    "type. It should end with a `.png` extension", UserWarning)
    png = self.get_screenshot_as_png()
    try:
    with open(filename, 'wb') as f:
    f.write(png)
    except IOError:
    return False
    finally:
    del png
    return True



Analysis



As per the snapshot of the error stack trace:



snapshot



You have used the command as:



driver.get_screenshot_as_file('new.jpeg')


The issues were:



  • The filename didn't end with .png

  • The desired full path of your filename wasn't provided.

Even if you desire to use save_screenshot() this method in-turn invokes get_screenshot_as_file(filename)




Solution



Create a directory within your project as Screenshots and provide the absolute path of the filename you desire for the screenshot while invoking either of the methods as follows:



  • driver.get_screenshot_as_file("./Screenshots/YakeshrajM.png")

  • driver.save_screenshot("./Screenshots/YakeshrajM.png")


Update



Currently GAed Chrome v73 have some issues and you may like to downgrade to Chrome v72. You can find a couple of relevant discussions in:



  • Getting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service mode

  • Timed out receiving message from renderer: 10.000 while capturing screenshot using chromedriver and chrome through Jenkins on Windows





share|improve this answer















This error message...



 UserWarning: name used for saved screenshot does not match file type. It should end with a .png extension
"type. It should end with a .png extension", UserWarning)


...implies that the Selenium-Python client encountered an issue while invoking get_screenshot_as_file() method.




get_screenshot_as_file()



get_screenshot_as_file() saves a screenshot of the current window to a PNG image file. Returns False if there is any IOError, else returns True. Use full paths in your filename.



  • Args:

    • filename: The full path you wish to save your screenshot to. This should end with a .png extension.



  • Usage:



    driver.get_screenshot_as_file('/Screenshots/foo.png')



  • Defination:



    if not filename.lower().endswith('.png'):
    warnings.warn("name used for saved screenshot does not match file "
    "type. It should end with a `.png` extension", UserWarning)
    png = self.get_screenshot_as_png()
    try:
    with open(filename, 'wb') as f:
    f.write(png)
    except IOError:
    return False
    finally:
    del png
    return True



Analysis



As per the snapshot of the error stack trace:



snapshot



You have used the command as:



driver.get_screenshot_as_file('new.jpeg')


The issues were:



  • The filename didn't end with .png

  • The desired full path of your filename wasn't provided.

Even if you desire to use save_screenshot() this method in-turn invokes get_screenshot_as_file(filename)




Solution



Create a directory within your project as Screenshots and provide the absolute path of the filename you desire for the screenshot while invoking either of the methods as follows:



  • driver.get_screenshot_as_file("./Screenshots/YakeshrajM.png")

  • driver.save_screenshot("./Screenshots/YakeshrajM.png")


Update



Currently GAed Chrome v73 have some issues and you may like to downgrade to Chrome v72. You can find a couple of relevant discussions in:



  • Getting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service mode

  • Timed out receiving message from renderer: 10.000 while capturing screenshot using chromedriver and chrome through Jenkins on Windows






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 30 at 17:00

























answered Mar 27 at 21:05









DebanjanBDebanjanB

54.6k14 gold badges56 silver badges106 bronze badges




54.6k14 gold badges56 silver badges106 bronze badges












  • @YakeshrajM Did you get a chance to look into this solution?

    – DebanjanB
    Mar 29 at 4:41











  • facing same issue still.. As i already mentioned that code was working good with previous version of chrome and chrome driver and i was able to save the screenshots in '.jpg' format itself.. '.png' extension is just user warning message, which can be neglible. As already told by Ryan Bowden it is an open issue in chrome and they are trying to fix it. So waiting for the fix eagerly.

    – Yakeshraj M
    Mar 30 at 16:59











  • @YakeshrajM Checkout the answer update and let me know the status.

    – DebanjanB
    Mar 30 at 17:01

















  • @YakeshrajM Did you get a chance to look into this solution?

    – DebanjanB
    Mar 29 at 4:41











  • facing same issue still.. As i already mentioned that code was working good with previous version of chrome and chrome driver and i was able to save the screenshots in '.jpg' format itself.. '.png' extension is just user warning message, which can be neglible. As already told by Ryan Bowden it is an open issue in chrome and they are trying to fix it. So waiting for the fix eagerly.

    – Yakeshraj M
    Mar 30 at 16:59











  • @YakeshrajM Checkout the answer update and let me know the status.

    – DebanjanB
    Mar 30 at 17:01
















@YakeshrajM Did you get a chance to look into this solution?

– DebanjanB
Mar 29 at 4:41





@YakeshrajM Did you get a chance to look into this solution?

– DebanjanB
Mar 29 at 4:41













facing same issue still.. As i already mentioned that code was working good with previous version of chrome and chrome driver and i was able to save the screenshots in '.jpg' format itself.. '.png' extension is just user warning message, which can be neglible. As already told by Ryan Bowden it is an open issue in chrome and they are trying to fix it. So waiting for the fix eagerly.

– Yakeshraj M
Mar 30 at 16:59





facing same issue still.. As i already mentioned that code was working good with previous version of chrome and chrome driver and i was able to save the screenshots in '.jpg' format itself.. '.png' extension is just user warning message, which can be neglible. As already told by Ryan Bowden it is an open issue in chrome and they are trying to fix it. So waiting for the fix eagerly.

– Yakeshraj M
Mar 30 at 16:59













@YakeshrajM Checkout the answer update and let me know the status.

– DebanjanB
Mar 30 at 17:01





@YakeshrajM Checkout the answer update and let me know the status.

– DebanjanB
Mar 30 at 17:01

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55350547%2fissue-in-taking-screenshot-in-selenium-while-using-chromedriver-73-for-chrome-ve%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현