Read and parse excel data

HI, i am looking for right excel library and way how to design test test in PyCharm. Excel file included 6-7 columns and many rows. It has to be loop to execute each row. I think to keep read data from excel in one file and execution in different . I need to get row information and path it to different file, then re-start loop after execution. Is it possible to do? Do i need to keep excel file in the project directory?
Does robotframework-datadriver allow only one Test Case per page?
I have excel file in PyCharm directory but i can’t open it even after click on Open in Excel Reader (robotfamework-excellib is installed ).

Thank you

Hi,

I would recommend you to install Robotframework-excellibrary-xwfintech

For more details check the post:

Regards

1 Like

Hi @natK,

I believe there is a confusion:

Either you want to read an excel file, then you are right to check for an excel library.

Or you want to generate test cases with data from an excel file, that’s why you use data driver. But then you would not need an excel library.

Which one is it?

Hi… on this step, i need to read data only … will take a look at
Robotframework-excellibrary-xwfintech… thank you all for replay

I can recommend RPA.Excel.Files from rpaframework. Its keywords are very convenient for reading (and writing) excel files:

Markus, thank you for idea.
Does RPA.Excel allow create new excel file and enter new row after each execution ? In manual they give an example to enter bulk of records

Is there any restriction on version of Python using. Because I’m unable to import RPA.Excel.Files
Library RPA.Excel.Files

Showing as Import File not found. Tried restarting PyCharm for 2 time but no solution.

Thanks,
Vivek Kulkarni

Hi @kulkarnivp
That’s funny! If you had asked me earlier, I would not have known. But I ran in to a similar problem yesterday:

Apparently, rpaframework does not work with Python 3.10, yet. When installing rpaframework under 3.10 you either get funny exceptions or pip only installs version 0.1.0 .

Robocorp states, that it does work officially on Python 3.7, but I also used it successfully with 3.8 and 3.9 (I did not try RPA.Excel module, though).

I hope that helps,
Markus

@Noordsestern ,

Thanks for the info. It was problem with 2 versions of Python running on my system. 2.7 and 3.9 removed 2.7 and installed rpaframework through pip command and got installed.

I’ll proceed with this from excel work flow.

Thanks,
Vivek Kulkarni

@Noordsestern

Seeing one more problem able to read teh data from XLS file but when tried to write back its not working. Test Case is passing but No Dats is saving teh excel file.

Could you please help me with this issue if you come accross.

Thanks,
Vivek

Probably, if you can share the test case. There is no the only 1 reason for data not being written to an excel file :wink:

Please find the test case below-

*** Settings ***
Library     SeleniumLibrary
Library     OperatingSystem
Library     RPA.Excel.Files

*** Test Cases ***
Excel Test Case 

    Open Workbook      D:\\OutputData.xls
    ${column1}=    Get cell value    1    2
    log to console             ${column1}
    Set cell value    1    3    Test_Value

Check out the examples at Excel.Files — RPA Framework documentation

I think you are missing the Save Workbook keyword, thus the modification of the cell is not persistent.