ATF how to click "Related Search Results" button

Sergey15
Giga Contributor

Hello!

How can I click "Related Search Results" button on the Incident form with ATF? I need to click the button to have related search results section expanded, and then verify that "Preview" or "Attach" or "Order" buttons are present, and then click those as well. I tried running the Inpsector, but it told me those buttons are "Blacklisted". I tried using "Click Component (Custom UI)" test step, but those buttons don't appear in the list. From what I understand, if a button is Blacklisted, it means that there is another way to test it. Does anybody know what way?

I don't even understand what adds "Related Search Results" button. I don't see it in the UI actions, so it must be something else. What? Is it part of the Incident form hardcoded?

 

Thank you!

4 REPLIES 4

Naveen20
ServiceNow Employee
ServiceNow Employee

From the Incident form -> Configure form layout and move the Contextual search results to right and it will show up.

 

find_real_file.png

Thank you for your reply. In my case "Contextual Search Results" are already on the page. But they are collapsed. To test them with the ATF I need to expand them by clicking "Related Search Results" button. How can I click that button with ATF?

sai195
Tera Contributor

If you have achieved this on anyhow, can you please help me how to get this?

Hendrik4
Tera Expert

You need to add a Test Step of type Click Component (Custom UI). Make sure that the current last step of your test shows the Incident. ServiceNow asks you whether you want to retrieve components. Click on Retrieve Components. This executes the test and the components are retrieved. When done, you should be able to select the component Button <button>: Related Search Results. This expands the Related Search.

Now you can use another Click Component (Custom UI) step to click on something in the results or Set Component Values (Custom UI) to, for instance, write a keyword into the search input field.

However, navigating inside the results does not work so well because you always need to find the right component. Depends on what you want to achieve.

Add Click Component (Custom UI) test step:
find_real_file.png

After retrieval of components:
find_real_file.png