How to validate search operation

hi
thanks
i want to performed search operation in list after performing search i want check wheather proper search will take place or not

    @{elements} =  Get Items List    ${loc_Column_data}
     ${origin}  Get Text   ${loc_Column_data}
    # Log    ${origin}
     @{searchElementsList}  Get WebElements  ${loc_listViewSearchBar}
     Click Element  ${searchBarElementsList}[0]
     Input Text  ${searchBarElementsList}[0]   ${elements}[1]  True
     Press Keys  ${searchBarElementsList}[0]  ENTER
     Page Should Contain  ${origin}

Hi Pratik

From what I understand you’d like to make a search via an input field and then validate that the search is successful with its result.

From what I gather you are using SeleniumLibrary as Input Text and Press Keys are from that library (always worth providing the library or libraries you are using when creating a post)

You also did not provide any information on the problem you are facing…
And I see you have a keyword "Get Items List" that returns something to "@{elements}=" which you are using the second item from your list ${elements}[1] as the value passed to the Input Text keyword, is this a custom keyword? My first thought was it was from the collections library but there’s no keyword matching that…

But ultimately for anyone to help you, you need to help anyone looking at the post first by providing some helpful information about the problem you are faced with, any exceptions etc…

All the best

1 Like