Hi Sunita, you can use following code snippet to take screenshot of a webpage using Selenium Ruby Webdriver:
browser = BrowserPool.instance.get_browser
browser.navigate.to 'https://google.com'
width = browser.execute_script("return Math.max(document.body.scrollWidth, document.body.offsetWidth, document.documentElement.clientWidth, document.documentElement.scrollWidth, document.documentElement.offsetWidth);")
height = browser.execute_script("return Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);")
browser.manage.window.resize_to([width+100, 1500].min, [height+100, 3000].min)
browser.save_screenshot("sample.png")