(TEST DATA) Define specific Excel Sheets to get Excel Values


#21
Object excelData = ExcelFactory.getExcelDataWithDefaultSheet("C:\\Users\\shilpi\\Downloads\\SOZUNIT.xlsx", "SOZUNIT", true)
	int rowcount = excelData.getRowNumbers()
	println(rowcount)

–getRowNumbers() is not accepting my code, any thing which i have to import or do to fix this


#22

Hi Shilpi,

Not accepting means? Is it not returning any value? or do you encounter any error message?

Could you confirm? Thanks!


#23

Hi Arnel,
Somehow its fixed but now while executing, getting error that file is unsupported.
Using katalon 6.1.5 and my file format is csv.


#24

Hi Shilpi,

I’m afraid that it only accepts .xlsx file. If you re using csv, try CSVData perhaps, but you can’t identify sheetname using that. It only reads its default sheetname.

Refer to this. . .

Hope that helps. . . :slight_smile:


#25

Yes, seems it is working in this way, but now getting some error …I believe this is due to int and string data comparison… plz help


#26

Hi
Use assert target.contains(rowcount.toString())


#27

Thanks HeleneB :slight_smile:


#28

Hi Shilpi,

Very sorry for my slow response, I’m quite busy on my work.

Thank you @HeleneB for handling this.

Cheers! :beers:


#30

Hi Guys,

New query - how can I delete previously downloaded CSV files from my system’s download folder.


#31

Hi Shilpi,

You can try this solutions and play with it. . .

Hope that helps. . . :slight_smile:


#32

Thanks , I am able to do it now with ref File Operations - Open any File and Delete file Using Custom Keyword in Katalon
but rather using as custom keyword I have created method and using that in my code.
not sure why as keyword it does not worked in feature file though as keyword it worked in manual scripts.


#33

These are more optimized code, will surely use it.
Thanks for quick responses :slight_smile:


#34

Cool!

Cheers :beers:


#35

I have element which get active on mouse hover.
First I have to hover mouse on element then upload files by click on that.
Three Actions at a time …please guide…
Mouse Hover, click and file upload


#36

Yes its worked :slight_smile:
added upload plugin and it worked .


#37

could you share the full code ( with dynamic for loop info for increasing each time )

i am trying login page to get data from excel file username and password each time for 10 users


#38

Hi Prakasam,

Sorry for my late response. . .

Based on my understanding, I can say that your case is quite simple, because there was no other information about it. . . Why don’t you just bind your test data in the test suite? By doing it you don’t have to hard code your case. The data binding will do the iteration for your test. You can only use ExcelFactory approach if you have multiple sheets in your test data.

Have a look into this links:

If that doesn’t answer your question, please provide a more information.

Hope that helps. . . :slight_smile:


#39

Hi Amal ,

below was my script , i am using local data … so could you please add for loop for below code

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘https://accounts.google.com/AccountChooser?service=mail&continue=https://mail.google.com/mail/’)

WebUI.setText(findTestObject(‘Object Repository/Login_data/input_Continue to Gmail_identifier’), findTestData(‘login_data/data’).getValue(
1, 1))

WebUI.click(findTestObject(‘Object Repository/Login_data/span_Next’))

WebUI.setEncryptedText(findTestObject(‘Login_data/input_Too many failed attempts_password’), findTestData(‘login_data/data’).getValue(
1, 2))

WebUI.click(findTestObject(‘Object Repository/Login_data/span_Next’))

WebUI.click(findTestObject(‘Object Repository/Login_data/span_Send feedback_gb_Ba gbii’))

WebUI.click(findTestObject(‘Object Repository/Login_data/a_Sign out’))data


#40

Refer to links I sent. . .


#41

i have done binding … but it was doing each time for one value only …

yes it was simple code . i just created this to check the loo condition … i am new for loop condition … that why i requested sample code for loop statement in katalon program