Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
Poonam12031990
Active particpant
Active particpant
Posts : 18
Join date : 2013-01-29

logging invalid inputs in a file Empty logging invalid inputs in a file

Tue Jan 29, 2013 3:37 pm
hi everyone,
i have a code in js which accepts inputs from json values and fills a form repeatedly(i looped it for a no. of inputs set).the form skips the invalid inputs and moves on but i want these invalid inputs to be stored somewhere.can anyone help me?
avatar
adityac
Professional
Professional
Posts : 101
Join date : 2013-01-17

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Tue Jan 29, 2013 6:05 pm
u want to store it in excel ???
avatar
Poonam12031990
Active particpant
Active particpant
Posts : 18
Join date : 2013-01-29

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Wed Jan 30, 2013 11:33 am
any file.............even text file will do
avatar
adityac
Professional
Professional
Posts : 101
Join date : 2013-01-17

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Wed Jan 30, 2013 4:02 pm
i tried same in java n i exported to excel... bt scenario wat i tried is generated code and result of code will be send to excel....if u requred i will paste the code..
avatar
Poonam12031990
Active particpant
Active particpant
Posts : 18
Join date : 2013-01-29

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Thu Jan 31, 2013 11:16 am
ya sure ....paste it please Smile!!!!!!
avatar
adityac
Professional
Professional
Posts : 101
Join date : 2013-01-17

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Thu Jan 31, 2013 2:34 pm

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Random;
/*poi*/
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public class ExcelExporting {

public int int1;
public int writeExcelFile(String fileName) {
FileOutputStream fileOutputStream = null;
HSSFWorkbook sampleWorkbook = null;
HSSFSheet sampleDataSheet = null;
try {


sampleWorkbook = new HSSFWorkbook();
sampleDataSheet = sampleWorkbook.createSheet();

HSSFRow headerRow = sampleDataSheet.createRow(0);
HSSFRow dataRow1 = sampleDataSheet.createRow(1);

Random randomGenerator = new Random();
int1=randomGenerator.nextInt(9000000)+1000000;
System.out.println("Number is:"+ int1);

HSSFCell firstHeaderCell = headerRow.createCell(0);

firstHeaderCell.setCellValue(new HSSFRichTextString("RN"));

dataRow1.createCell(0).setCellValue(
new HSSFRichTextString(""+int1));
fileOutputStream = new FileOutputStream(fileName);
sampleWorkbook.write(fileOutputStream);
} catch (Exception ex) {
System.out.println(ex);
} finally {

try {
if (fileOutputStream != null) {
fileOutputStream.close();
}
} catch (IOException ex) {
System.out.println(ex);
}
}
return int1;
}

public static int Export(){
int int2 = new ExcelExporting().writeExcelFile("G:\\Excel\\Excel2.xls"); /*this method will return int1 value and we are assigning to int2 */
return int2;
}

}


This might help u....
avatar
Poonam12031990
Active particpant
Active particpant
Posts : 18
Join date : 2013-01-29

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Fri Feb 01, 2013 11:08 am
hey i tried your code in eclipse but it gives error saying HSSFWorkbook,HSSFSheet, HSSFRow,HSSFCell, HSSFRichTextString do cannot be resolved to a type and the available fixes ask for creating a class of the respective type........................do i need to import some file or declare any variable? Question
avatar
adityac
Professional
Professional
Posts : 101
Join date : 2013-01-17

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Fri Feb 01, 2013 11:37 am
yes u need to add poi jar for tht....
avatar
Poonam12031990
Active particpant
Active particpant
Posts : 18
Join date : 2013-01-29

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Fri Feb 01, 2013 12:53 pm
k.....thanks...can you tell me a link to download these jar files?
avatar
adityac
Professional
Professional
Posts : 101
Join date : 2013-01-17

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Fri Feb 01, 2013 3:24 pm
http://www.jarfinder.com/index.php/jars/versionInfo/44527
avatar
Poonam12031990
Active particpant
Active particpant
Posts : 18
Join date : 2013-01-29

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Fri Feb 01, 2013 4:25 pm
thanks!!!!!!!!!!!!!!!! will check it out...........
Sponsored content

logging invalid inputs in a file Empty Re: logging invalid inputs in a file

Back to top
Permissions in this forum:
You cannot reply to topics in this forum