Tuesday, September 7, 2010

How to capture screenshot in selenium

Its easy to take a screenshot in selenium . We just need to use the below command.

selenium.captureEntirePageScreenshot("F:\\fullscreenshot","background=#CCFFDD" );

Screenshot will be taken at the time of execution of testcase and will be stored as png file in respective folder as mentioned .In our case it is F:\ fullscreenshot.png.

Enjoy Testing
www.mpowerglobal.com

2 comments:

  1. Hello Farheen,

    i am muzzamil. I am working in delhi & my company not working on Selenium but i like this tool currently i am working on selenium webdriver ver 2.19.0 with junit framework.

    i have a problem, i want to select a picture from PC to upload to web but dont know how i can interact with Open window for select pic from PC plz Help me


    Ragrds
    Muzzamil

    ReplyDelete
  2. kindly look into http://seleniumready.blogspot.in/2010/11/how-to-upload-file-in-selenium.html

    ReplyDelete