0

Which library to import in Python to read data from an Excel file, I want to store different xpaths in Excel file for automation testing using Selenium?

1

2 Answers 2

1

You may use XlsxWriter. It is a Python module for writing files in Excel. xlutils is also very useful collection of utilities for automating excel sheet operations.

https://xlsxwriter.readthedocs.io/

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
0

The xlrd library is what you are looking for to read excel files. And to write, you can use xlwt.

10 Comments

Actually like in java there is a file excelreader.java in apache POI like that , I want to read data from excel file for xpaths, so I am looking a file which can read data in python
xlrd does that. Install it using pip install xlrd. Then you can import it in your projects and use it to read excel files like book = xlrd.open_workbook(file). From that you can access sheets, rows, and columns.
@Kidus__ If you have an example of reading data in python and selenium can u please paste it here. Thanks in advance.
You can Google for examples. But here's one on xlrd: blogs.harvard.edu/rprasad/2014/06/16/…
Thank you @Kidus for help. I will use this example blogs.harvard.edu/rprasad/2014/06/16/...
|

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.