Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
380 views
by The go-to Tester (324 points)
retagged by
I am creating CSV file with selenium scripts(JAVA). and using '\n' for entering data in new line.

The created file is working fine as a excel file but not in csv format.
by Expert (572 points)
Can you post your code? What language are you using?
by The go-to Tester (181 points)
Edited and removed the tag selenium-java as this is a Java problem.

1 Answer

0 like 0 dislike
by The go-to Tester (143 points)

Hi Vipul Sharma,

First of all, I am assuming that you probably you opened the file in an editor which doesn't recognize '\n' as a newline character. 

I would suggest you use editors like:

  1. Notepad ++
  2. Notepad
  3. Vim
  4. EditPlus

These editors recognize '\n' as a newline character. 

Secondly, You should not directly open the file with Excel, which may not be able to detect that it is a CSV file.

Try opening the file from Excel by 

File -> Import -> CSV File

 


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...