Is it possible to define documentation for test cases?

We are working on a Test Suite and we have several test cases, however, we would like to document it in a more end-user readable way such as "Cucumber" https://cucumber.io/

Example
"
Feature: Hello Cucumber
As a product manager
I want our users to be greeted when they visit our site
So that they have a better experience

Scenario: User sees the welcome message
When I go to the homepage
Then I should see the welcome message
"

How can we achieve such enriched documentation in Katalon Studio?

Thanks in advance,
Victor

Tagged:

Comments

  • Right click the test case in the tree on the left side of the window. Then select properties. There is room in the dialog that opens to put things like this in the description.

  • Your best contribution for us is to providing us feedbacks related to current features of Katalon Studio and also help us to address questions from users in this forum :)
  • Can you pass me your Katalon commands which you've used?
  • You can resolve this with 2 solutions - Using regex in xpath or by parameterizing the objects.

    Solution 1- use regex in XPATH like starts with to identify the elements. In the object repository,  set the xpath value as  //*[starts-with(@id, 'ext-gen')] 
    Solution 2 -  parameterize the objects. The documentation for this  is available  here. https://docs.katalon.com/display/KD/Manage+Test+Object#ManageTestObject-ParameterizingTestObject
  • Thanks for the reply. With this answer, I assume Katalon can do all selenium 3.0 can.

     
  • Hi Hari,

    I can't think of anything that Selenium 3.0 can do that the current Katalon Studio cannot.
  • The root cause of your issue is displayed as an obvious error message: Cannot find test case with id ‘Test Cases/ejmplo1’, …] => Please double check if you pass in a correct test case in 'Call Test Case' step, otherwise it will produce this error.
  • Thanks but that doesn't work in case of test suites. I wanted to launch the browser once before a test collection starts & close it after it ends.

    The set up & tear down methods appears to work only for test cases & not test suite collection.
  • Yes we have setUp and tearDown methods which are similar to your case, please refer to this article
  • If the font-size is 20, then the whole keyword will return 20, e.g:

    cssValue = WebUI.getCSSValue(findTestObject('Page_CuraAppointment/btn_BookAppointment'), 'font-size')

    //Print out 20 in my example

    println cssValue

     
  • Hi

    Thanks for the quick response, so in this example

    WebUI.getCSSValue(findTestObject('Page_CuraAppointment/btn_BookAppointment'), 'font-size')


     if the font size is 20 where will that result be? Or would I have to put 20 instead of 'font-size'?
    If not should I use a different item?
    If so which one might be most useful to me?

    Thankyou
  • The result is stored in that keyword itself, if you look at our keyword's document: https://docs.katalon.com/display/KD/%5BWebUI%5D+Get+CSS+Value

    Example:
    'Get \'font-size\' CSS value of \'Book Appointment\' button'

    WebUI.getCSSValue(findTestObject('Page_CuraAppointment/btn_BookAppointment'), 'font-size')
  • Below is an example keyword to retrieve value from a cell using given row and column index:
    /** 
    * Get text of a cell which is identified by row index and column index 
    * @param rowIndex Index of row, start at 1 
    * @param columnIndex Index of column, start at 1 
    * @return Value of specific cell 
    */ 
    @Keyword 
    def getCellText(TestObject table, int rowIndex, int columnIndex) { 
    WebElement eTable = WebUiBuiltInKeywords.findWebElement(table); 
    WebElement row = eTable.findElements(By.tagName("tr")).get(rowIndex - 1); 
    List<WebElement> cells = row.findElements(By.tagName("td"));
    WebElement element = cells.get(columnIndex - 1) 
    return element.getText() 
    }
    You need to pass in your table object and index of row/column in that table as well.
  • You can't automate recaptcha verifications because that is a way to prevent automation.
  • Thanks for your reply...
  • No that's incorrect. Execution performance is varied for different environments but Katalon Studio have some fixes to execution recently to achieve acceptable performance.
  • I'm not clear about your question. Is it selecting Chrome as a browser for execution?
  • I'm sorry Hanh Tran, but this is not a right answer for my problem.

    It seems to me you don't understand what I need to do.

    The GlobalVariable in a Test Collection is reset at every Test Suite start and than the Login step is repeated. After that there is another problem: every test suite close the browser also without WebUI.closeBrowser().

    It's a mess.
  • So things are getting complicated. What you are trying to do will break the usual flow of test suite if you execute it separately. I suggest that each Test Suites should be independent of each other , do not try to mess it.

    I can suggest you the following workaround by having 'gl_isLogin' variable (default is true)

    if (already logged in)

    {

       GlobalVariable.gl_isLogin = true

    }

    else

    {

      //Not logged in yet, insert login steps below

      WebUI.setText(userName)

      WebUI.setText(password)

    .....

    }

    End of 'Login' Test Case before you trying to close browser

    if (GlobalVariable.gl_isLogin == true)

    {

    //Do nothing

    }

    else

    {

     WebUI.closeBrowser()

    }

     

     
  • Yes, but the browser is closed after each Test Suite in a collection!
  • Do you know any indications from your application that you've logged in successfully like successful login message? If so, you can add a flag in 'Login' test case to avoid re-executing:

    if (condition to check for successful login)

    {

       //Do nothing here

    }

    else

    {

      //Not logged in yet, insert login steps below

      WebUI.setText(userName)

      WebUI.setText(password)

    }
  • Ok got it. Thanks !!
Sign In or Register to comment.