seleniumkatalon-studiowebautomationkatalon-recorder

Repeating actions with Selenium with a different value each time


I am new-ish to Selenium, so I use Katalon Automation Recorder through Chrome to quickly draft scripts.

I have a script that makes an account on a website, but I want to make more than one account at a time (using a catchall). Is there a way for Selenium/Katalon to alternate its input from a database of preset emails (CSV sort of thing) or even generate random values in-front of the @domain.com each time the script loops over?

Here is the current state of the script: katalon script

Thanks


Solution

  • As @Shivan Mishra mentioned, you have to do some data driven testing. In Katalon you can created test data in object repository (See https://docs.katalon.com/katalon-studio/docs/manage-test-data.html)

    You can manage your test data in script like following example:

    import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
    
    def data = findTestData('path/to/your/testdata/in/object repository')
    
    for(int=0;i<data.getRowNumbers();i++){
     def value = data.getValue(1, i)
        // do any action with your value
    }