Am 11.02.2013 16:40, schrieb Love U Ruby:
> Hi,
>
> I stuck in a point in my code. I have an excel which contains values as
> below :
>
>
> Tax code
> ========
>
> wst-45
> tre-2%
> 12.45%
> 10
> 5
> ascht5
>
> When my code is trying to read the values only the bad data is coming
> from the values like 5,10.. They are being converted to 10.0,5.0. Which
> causes my code to fail,as in the select list no such values like 10.0 or
> 5.0. I tried to fix it by formatting the Excel column as "Text",but
> doesn't work.
>
> CODE:
>
> if wbs.cells(rows,8).value != nil
>
> elem = driver.find_element(:name, "defaultAnswerId")
> option = Selenium::WebDriver::Support::Select.new(elem)
> puts wbs.cells(rows,8).value
> default_val = wbs.cells(rows,8).value.strip
> option.select_by(:text, default_val)
>
> end
>
>
> any idea how to fix that.

Not without the information where the `wbs' object came from.

Also, if your problem is not related to Selenium then most of
your provided code seems not to be relevant here.

Please provide a code snippet as self-contained and to the point
as possible.


-- 
<https://github.com/stomar/>