18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

How to export list control data into text/excel file ?

kplokeshkplokesh Members
edited November -1 in Sahi - Open Source
Hi,

When I am trying to export list/drop-down control data into text/csv file it's exporting as a individual characters but I want as it is.

I have used following code:-
var $aa=_getText(_select("location"));
_writeCSVFile($aa,"C:/Users/lokeshk/Desktop/ab.txt");

Actual Result :-

"s",a","h","i","t","e","s","t"
"l","o","k","e","s","h"

Expected result:-
sahitest
lokesh


Thanks,
Lokesh.

Comments

  • Hi Lokesh,

    The code should be:

    var $aa=_getText(_select("location"));
    _writeFile($aa,"C:/Users/lokeshk/Desktop/ab.txt");

    If you want to write the contents into CSV file then it should be:

    var $aa=_getText(_select("location"));
    _writeCSVFile($aa,"C:/Users/lokeshk/Desktop/ab.csv");

    Regards
    Sumitra
  • kplokeshkplokesh Members
    edited January 2012
    Hi Sumitra,

    Thanks for your quick reply it's working fine.

    thanks,
    lokesh
This discussion has been closed.