Getting past Show notifications popup in Salesforce

I am new to Katalon and trying to test Salesforce. I run a test case record and successfully login to my Salesforce Org. However Salesforce displays a popup with Show notications, Allow, Block and I click on Block. Katalon does not record this action. What do you do if Katalon does not record selection in a popup?
image

If I Run the test case I get a failure:
=============== ROOT CAUSE =====================
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_Flows Salesforce/div_View profile_slds-r4’ located by ‘//div[@id=‘457:83;a’]/div/div[4]’ not found

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

Hi,

Welcome to our community. Will you be able to use Object Spy to test the pop-up button please?

Thanks. I have tested this problem without the Katalon test case and the pop-up does not occur. It only occurs when I run the test case in Katalon. So I know the problem is with your software.

I would be happy to share my screen and show someone the error.
Richard Case
925 389 1991
rhcase@pspenterprises.com

I really like Katalon and hope we can get past this problem.

Attached is a video of the problem.

Can you do us a favour and restart your application and then go back to the object that you “spied” on to get the pathway quoted above? Use the Spy again on this object. Did you get the same pathway, especially with the <id> attribute, or did you get a different one?

If you got a different one, then you have dynamic attributes. That means the attribute changes every time you start the application. To get around this, you have to review the HTML and review other attributes that may be stable or use functions, like “contains”, to use only stable parts of the dynamic attributes. We can assist you, but we would need to see the HTML of the objects in question.

Here is an example of creating pathways to dynamic attributes:

Edit: Katalon Team (@support.squad) has put together several posts to assist in using Katalon with Salesforce. You should review them as well.

I tried Object Sky but I’m not sure how to use it. It does not seem to be capturing anything.

Attached is a video I created showing the problem:

Review these other Posts on dynamic pop-ups to help you move past it.

To assist you on getting the pathways for the button object(s), stop your recording and use the F12 key and then select, “Open DevTools”. Then use the first icon on the top area of Dev Tools to select your objects. You may have to create the pathway to the button you want, but if you show the HTML, we can assist.

Mike, I do not understand. If I am having this problem, so is every other Salesforce tester. Let me be clear:

If I login to Salesforce without Katalon I do not see the popup at all.
If I run my test case under Katalon, I see the popup. Why?

I have set up an example for you:

Directly, not using Katalon, goto https://login.salesforce.com/
Username = test@pspenterprises.com
Password = Katalon1
You will NOT see any popup.

Now do the same thing with Katalon.
You will see this popup:
image.png
Please help fix this.

Mike, I am very new to Katalon. If I run my application directly I do not see the pop-up. If I run it via Katalon, I see the popup. It is a bug in your system.

I cannot change the HTML of Salesforce.

I am happy to have a zoom call and show this to you.

Please view the attached video to see this happen.

Hi,

I found this doc mentioning that:
Add Desired Capability to handle Popup (Show Notification). You can refer to Manage Desired Capabilities in Katalon Studio. Can you please try. Our KShare series about Salesforce testing is also available here: Search results for 'KShare Salesforce' - Katalon Community.

Thank you for the referrals. However, I need to get past this Katalon error.

If I login to Salesforce without Katalon I do not see the popup at all.
If I run my test case under Katalon, I see the popup. Why?

I have set up an example for you:

Directly, not using Katalon, goto https://login.salesforce.com/
Username = test@pspenterprises.com
Password = Katalon1
You will NOT see any popup.

Now do the same thing with Katalon.
You will see this popup:
image.png
Please help fix this.

Sorry, what is an Incognito tab? I use Chrome. And the test below was Chrome.

Ok I used Katalon to just open Google and did not get the pop up.

I then used Katalon to open Google and then Sign in as myself and then Login to Salesforce. I got the popup.

Hi,

We have a guide on this issue here. Please refer to
CST-How to disable Notification Popup using Robot Keyword-090524-052344.pdf (105.5 KB)

1 Like

try to use robot script for manual key press of ESC or Enter key which might fix your problem

//Create object of Robot class
		Robot robot = new Robot();
		//Code to Enter D1.txt 
		//Press Shify key 
		robot.keyPress(KeyEvent.VK_SHIFT);
		//Press d , it gets typed as upper case D as Shift key is pressed
		robot.keyPress(KeyEvent.VK_D);
		//Release SHIFT key to release upper case effect
		robot.keyRelease(KeyEvent.VK_SHIFT);
		//Press ENTER to close the popup
        robot.keyPress(KeyEvent.VK_ENTER);  
1 Like

Looping in one of our Product Support team members/KShare contributors in this thread so they can have a look at this issue @bhavyansh.ameta

1 Like

Hi folks @here:, :wave:

As we have not received any new replies since my last comment, we will presume that the issue is now resolved and will proceed to close this topic.

Should you encounter similar issues, or have other questions, please feel free to Ask the Community for support! :+1:

Thanks,
Albert

1 Like