nithinc
nithinc

Reputation: 11

How to open a local pdf file through chrome driver?

Is there a way to open a local pdf file using chrome driver? I have tried this

driver().switchTo().window("file://C:\Users\ashok\Downloads\fileToRead.pdf")

which is not working for me. Please help. Thanks

Upvotes: 0

Views: 561

Answers (1)

Prophet
Prophet

Reputation: 33351

Local files can be opened with simple driver.get().
Also the slashes should be corrected.
Try this:

driver().get("C://Users/ashok/Downloads/fileToRead.pdf")

Upvotes: 1

Related Questions