TypeError: object of type 'float' has no len() Error while reading data from Excel in Robot Framework.

1,371 views
Skip to first unread message

Swathi Vegesna

unread,
May 23, 2017, 8:23:35 AM5/23/17
to robotframework-users

Hi,

  While Reading the data from Excel, I am getting the TypeError: object of type 'float' has no len()  Error  . So not able to input the data from the Excel.

I am trying to read  the data  “5178” from the excel, then I am getting the error.

If I put  “51” then  able to read the data successfully.

 

Below is the code.

*** Settings ***

Documentation     This function is to read the data from Excel

Suite Teardown    Close Browser

Library           Selenium2Library

Library           OperatingSystem

Library           ExcelLibrary

 

*** Test Cases ***

Read Data From Excel

    Open Browser    https://google.com    googlechrome

    GoogleLogin

 

*** Keywords ***

GoogleLogin

    Open Excel Current Directory    TestExcel.xls

    ${searchitem}=    Read Cell Data By Name    TestSheet1    B3

    Input Text    name=q    ${searchitem}

 

So could you please help me in resolving issue.

Below are the versions I am using.

Python: 2.7.13

Robot Framework: 3.0.2

Excel Library: 0.0.2



SampleTest.zip

swathi simhadri

unread,
Dec 17, 2018, 7:27:43 AM12/17/18
to robotframework-users
Hi Swathi 

Did you got any solution for this problem ? Because am also facing the same issue....
Can you Please help in sort this error

Thanks & Regards
Swathi S

Maksood Khan

unread,
Dec 17, 2018, 8:12:59 AM12/17/18
to swathi.s...@gmail.com, robotframework-users
Even I faced this issue I resolved it as below,

Xlval= read value from XL.
Sstr1= convert to string Xlval
Sstr2=replace string Sstr1 .0  {$Empty}
Input xpath Sstr2
Note:: Before setting value if ur field accept only number than use convert to number on Sstr2.

Regards, 
Maksood

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages