when my test case finish runs and close window it start again and repeat same data given in excel , can someone help
More information needed.
See
This is my test case it runs perfectly but when it close window the same test case start again
the problem is the test case runs twice and it duplicates same data
in my data there is only 2 colums fields with info is that why it runs twice
WebUI.openBrowser('')
WebUI.maximizeWindow()
WebUI.executeJavaScript('window.open();', [])
currentWindow = WebUI.getWindowIndex()
WebUI.switchToWindowIndex(currentWindow + 1)
WebUI.navigateToUrl('https://sellercenter/user/auth/login')
WebUI.setText(findTestObject('Object Repository/New Folder/Page_Seller Center/input_person_email'), usernamess)
WebUI.setEncryptedText(findTestObject('Object Repository/New Folder/Page_Seller Center/input_https_password'), passwordss)
WebUI.click(findTestObject('Object Repository/New Folder/Page_Seller Center/input_Mot de passe oubli_submit'))
WebUI.closeWindowIndex(1)
WebUI.switchToWindowIndex(0)
for (def rowNum = 1; rowNum <= findTestData('New Folder/New Test Data').getRowNumbers(); rowNum++) {
WebUI.switchToWindowIndex(0)
WebUI.navigateToUrl('https://sellercenter/create/find-master')
WebUI.click(findTestObject('Object Repository/New Folder/Page_Add a Product Seller Center/a_Create a new Product'))
WebUI.setText(findTestObject('Next step 1/Page_Add a Product Seller Center/input_PrimaryCategory'), findTestData('New Folder/New Test Data').getValue(
1, rowNum))
WebUI.click(findTestObject('Next step 1/Page_Add a Product Seller Center/i_Search_iconset-btn iconset-search'))
WebUI.click(findTestObject('Next step 1/Page_Add a Product Seller Center/div_Maison, cuisine bureau Bricolage et Rnovation lectricit Disjoncteurs, centres de charge et fusibles'),
FailureHandling.STOP_ON_FAILURE)
WebUI.click(findTestObject('Next step 1/Page_Add a Product Seller Center/input_Disjoncteurs, centres de charge et fusibles_submit'))
WebUI.delay(5)
WebUI.setText(findTestObject('Next step 2/Page_Seller Center/input_Name_mainname'), findTestData('New Folder/New Test Data').getValue(
2, rowNum))
WebUI.setText(findTestObject('Next step 2/Page_Seller Center/input_Name (Arabic)_mainname_ar_MA'), findTestData('New Folder/New Test Data').getValue(
3, rowNum))
WebUI.setText(findTestObject('Next step 2/Page_Seller Center/input_Brand_mainbrand'), findTestData('New Folder/New Test Data').getValue(
4, rowNum))
WebUI.click(findTestObject('Next step 2/Page_Seller Center/button_Enter Product Details'))
WebUI.delay(5)
WebUI.selectOptionByValue(findTestObject('Next step 3/Page_Seller Center/select_Please select Default Reduced rate 10 Reduced rate 14 Reduced rate 7 Zero'),
option, false)
WebUI.click(findTestObject('Next step 3/Page_Seller Center/legend_Product Specification'))
WebUI.setText(findTestObject('Next step 3/Page_Seller Center/input_Main Color_other_detailscolor'), findTestData('New Folder/New Test Data').getValue(
5, rowNum))
WebUI.setText(findTestObject('Next step 3/Page_Seller Center/input_Main Material_other_detailsmain_material'), findTestData(
'New Folder/New Test Data').getValue(6, rowNum))
WebUI.click(findTestObject('Next step 3/Page_Seller Center/legend_Product Description'))
WebUI.click(findTestObject('Next step 3/Page_Seller Center/a_Product Description_html'))
WebUI.setText(findTestObject('Next step 3/Page_Seller Center/textarea_Product Description_other_detailsdescription'),
findTestData('New Folder/New Test Data').getValue(7, rowNum))
WebUI.click(findTestObject('Next step 3/Page_Seller Center/a_Product Description (Arabic)_html'))
WebUI.setText(findTestObject('Next step 3/Page_Seller Center/textarea_Product Description (Arabic)_other_detailsdescription_ar_MA'),
findTestData('New Folder/New Test Data').getValue(8, rowNum))
WebUI.click(findTestObject('Next step 3/Page_Seller Center/a_Spcifications_html'))
WebUI.setText(findTestObject('Next step 3/Page_Seller Center/textarea_Spcifications_other_detailsshort_description'),
findTestData('New Folder/New Test Data').getValue(9, rowNum))
WebUI.click(findTestObject('Next step 3/Page_Seller Center/a_concat(What, , s in the box)_html'))
WebUI.setText(findTestObject('Next step 3/Page_Seller Center/textarea_concat(What, , s in the box)_other_detailspackage_content'),
findTestData('New Folder/New Test Data').getValue(10, rowNum))
WebUI.setText(findTestObject('Next step 3/Page_Seller Center/input_Product weight_other_detailsproduct_weight'), findTestData(
'New Folder/New Test Data').getValue(11, rowNum))
WebUI.setText(findTestObject('Next step 3/Page_Seller Center/input_Keywords_other_detailskeywords'), findTestData('New Folder/New Test Data').getValue(
12, rowNum))
WebUI.click(findTestObject('Next step 3/Page_Seller Center/button_Enter Product Variations'))
WebUI.delay(5)
WebUI.setText(findTestObject('Next step 4/Page_Seller Center/input_Sale End Date_variations0sku_seller'), findTestData(
'New Folder/New Test Data').getValue(13, rowNum))
WebUI.setText(findTestObject('Next step 4/Page_Seller Center/input_Sale End Date_variations0quantity'), findTestData(
'New Folder/New Test Data').getValue(14, rowNum))
WebUI.setText(findTestObject('Next step 4/Page_Seller Center/input_Sale End Date_variations0price'), findTestData('New Folder/New Test Data').getValue(
15, rowNum))
WebUI.setText(findTestObject('Next step 4/Page_Seller Center/input_Sale End Date_variations0special_price'), findTestData(
'New Folder/New Test Data').getValue(16, rowNum))
WebUI.setText(findTestObject('Next step 4/Page_Seller Center/input_Sale End Date_variations0special_from_date'), findTestData(
'New Folder/New Test Data').getValue(17, rowNum))
WebUI.click(findTestObject('Next step 4/Page_Seller Center/button_Upload Images'))
WebUI.uploadFile(findTestObject('Next step 5/Page_Seller Center/input_Browse_images1'), findTestData('New Folder/New Test Data').getValue(
18, rowNum))
WebUI.delay(5)
WebUI.uploadFile(findTestObject('Next step 5/Page_Seller Center/input_Browse_images2'), findTestData('New Folder/New Test Data').getValue(
19, rowNum))
WebUI.delay(5)
WebUI.uploadFile(findTestObject('Next step 5/Page_Seller Center/input_Browse_images3'), findTestData('New Folder/New Test Data').getValue(
20, rowNum))
WebUI.delay(10)
WebUI.doubleClick(findTestObject('Next step 5/Page_Seller Center/input_Upload Images_product-form-submit-btn'))
WebUI.verifyElementVisible(findTestObject('Next step 5/Page_Seller Center/div_Your product was created successfully and will be reviewed shortly'))
}
WebUI.closeWindowIndex(0)
WebUI.closeBrowser()
Do you execute this Test Case as a part of a Test Suite?
If you execute a Test Suite, then check its “Execution Information”
Possibly you have some retry configured.
Nothing I can do.
You are to clean up the data yourself. It would be easy. Open your data (.xlsx or .csv) in Microsoft Excel, delete unwanted rows manually, and save it. Then pass the fixed file to Katalon Studio.
i know how to clean it, i just want to show you if i set text in row number 30 test case will run also 30 times
Yes, Katalon’s “Data Driven Testing” is designed as such.
Is it alright if I close this issue?
Ofcourse will do, because katalon will think you have 30 lines of valid data with the default settings.
You can choose the data interval when you bind the test data to your test suite, most probably at this moment you have ‘run all’.
see the pic:
but having a clean data file is also desired, currently you have a mess there.
tnx for your time
thank you that was helpful
one of my favorite joke, long time ago, when using a shared excel file across the team.
scrolling dooooown and put whatever in the row > 1000.
just to teach a lesson to the guys blindly hitting print
so i was grabbing popcorn and waiting for the secretary to scream ‘who is the idiot printing blank pages’
(the office printer was nearby her desk)