← Back to team overview

sikuli-driver team mailing list archive

[Question #289268]: Using Java variable in Sikuli

 

New question #289268 on Sikuli:
https://answers.launchpad.net/sikuli/+question/289268

/* The code below is a Java code in selenium webdriver. The code reads a long list from an excel sheet.
       It stores the values in each excel cell in variables, LastName and  FirstName.
        I need to use the variables in a query, after navigating to SQL Server management studio database.	  
        This is where am having issues. when I use the command  'screen.type(LastName);'
        The variable LastName throws cannot be resolved to a variable error 
		
		QUESTION. How do I use the variables LastName and FirstName defined in Java in Sikuli. 

HELP PLEASE!
*/
		
	File src = new File ("C:\\EmployeeList.xlsx");
	FileInputStream fis = new FileInputStream(src);
	XSSFWorkbook wb = new XSSFWorkbook(fis);
	XSSFSheet sheet1 = wb.getSheetAt(0);
	int rowcount=sheet1.getLastRowNum();
	System.out.println("Total Row is :" + rowcount);
	
	for (int i=0; i<rowcount;i++)
	{
	String LastName=sheet1.getRow(i).getCell(0).getStringCellValue();	
	String FirstName=sheet1.getRow(i).getCell(1).getStringCellValue();	
	System.out.println("Data Employee List is " +i+ " "+"is "+ LastName+ ", "+FirstName+");
	}
	wb.close();
	
	//Navigated into SQL Server management studio database
	  screen.type(LastName);


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.