I am trying to automate a web app using Selenium Webdriver. The app involves user opening a book which is rendered in either PDF or ePub format, it allows user to highlight the text which they prefer. I am having difficulty in creating steps for the action where user selects text and highlights it.

PS : Once the text is selected from front end, the system makes a backend call.

  • Recording? Are you using Selenium IDE? Commented Jan 25, 2016 at 18:50
  • Webdriver. Didn't mean that recording. Apologies. Commented Jan 25, 2016 at 19:33

1 Answer 1


PDFs and ePubs are shown in the browser with plugins. Selenium cannot access these documents.

If you use Windows you could have a try with AutoIt. On Linux and Macs I think you have to fallback to something like Sikuli after the document is opened.

Some reads:

  • Thank you but I don't think this is what I am trying to achieve, my aim is to highlight a text inside an e-Reader. The e-Reader, renders the books a user has saved in his personal library in PDF or ePub format. The link that you shared automates, the process of opening a PDF document. Commented Jan 25, 2016 at 23:24
  • Maybe not, but the point is you cannot access the PDF/ePub with Selenium. You need to use another tool to select the PDF content. For example AutoIt, although the example blog post might not do what you exactly want they should be able to direct you in the right direction to solve it yourself. Commented Jan 26, 2016 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.