Search in the table

Scenario is to enter the search text in the search box(no need to enter any key) and result should display in the table.
How to do this, please help.

Can you ‘Enter the search text in the search box’ manually? If you can, then you create a script that does the same process. You may even use the record feature if you want to try it out to get you started.

Record Web Utility | Katalon Docs

1 Like

Thanks for the reply.
I did the same as suggested by you but when I am trying to execute, it is not working properly.
Scenario is:

  1. Enter the text manually in the search box
  2. Result should display
  3. Click on the down arrow to expand the row(searched result)
  4. Perform some transactions

When you say the above, are you getting an error message or you are not getting the expected feedback from your form?

The below is something I use for one of my Search boxes. Obviously, I made the objects for my system and the xpaths behind the objects are tailored for my system, but you may be able to see a path to getting your “search in the table” to work.

import org.openqa.selenium.Keys as Keys
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI'input_SearchBox'))
// throw in the name we will be searching for
WebUI.setText(findTestObject('input_SearchBox'), "XXXXX")
WebUI.sendKeys(findTestObject('input_SearchBox'), Keys.chord(Keys.TAB))
// wait until get search result back
WebUI.waitForElementVisible(findTestObject('drop_down.SearchResults'), 10)'drop_down.SearchResults'))
*** // Perform some transactions
1 Like

Thanks for the solution.
But this is also not working . I am not getting expected output.
Search is not working correctly.

Always I am getting the first record instead of the searched result

Can I assume you have got your Search “somewhat working” but it is returning the first record and not the record you expect? Can I see the code you are using at this time?

I am going to assume that you used the Web Spy to find your elements instead of looking into the HTML of the page. And perhaps you selected the first element of the table?

Maybe the below link will help you.

How to handle Web Tables | Katalon Docs