What will be the output for the below code? (consider selenium imports are done correctly)

1.	driver = webdriver.Chrome(executable_path="D:\\chromedriver.exe")
2.	driver.get_screenshot_as_file("D:\\image1.png")
3.	driver.get("http://www.google.com")
4.	driver.get_screenshot_as_file("D:\\image2.png")
5.	driver.quit()

Throws compile time exception at line number 2
Throws compile time exception at line number 3
Successfully executes the above line of code but only line 4 screenshot will be taken because in line 2 application not yet opened.
Successfully executes the above line of code by taking both the screenshot in line 4 and line 2
Verified Answer
Correct Option - d

To get all Infosys Certified Selenium with Python Automation Tester Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram