Help! I'm unable to set text to elements on popup modal!

Hello,
I need help on switching to a modal pop window and setting text on the modal window and navigate back to parent page. The modal has no URL so, I cannot use switch to url. The modal has a title “New Lead” but, for some reasons Katalon is not able to switch and find the title of the modal window. I’m working on Salesforce.com and I’m trying to create a new Lead. So far I’m able to click on Lead, New and the modal window pops up. When I try to set test nothing happens and my test fails. I will attach the error.

Error: Unable to set text ‘TestCompany’ of object ‘Object Repository/SFDC_Lead_OR/Page_Recently Viewed Leads Salesf/input__901326a’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/SFDC_Lead_OR/Page_Recently Viewed Leads Salesf/input__901326a’ located by ‘By.xpath: //input[@id=‘90:1326;a’]’ not found)


This is the field of the company name that can’t be reached:

Any help will be apprciated on this.
Note: Salesforce.com Lightning experience is very dynamic, the next time you click on an element to inspect it changes for example, the id’s changes. So, if there is also anyone who has had a success testing Salesforce.com lightning using Katalon your insight will be much appreciated.
Thanks.

ErrorKatalon.png

htm2.png

Modal Popup.png

Modal Window…png

htm1.png

ErrorKatalon2.png

CodeKatalon.png

xpath.png

Hello, forget all automatically generated paths, you need to find first stable element before input field, like “Company”… my guess (since you don’t show HTML of that field) xpath of input field should look something like:
//*[contains(text(), “Company”)]//input

*** Edit - actually that generated xpath with neighbor containing ‘Company’ looks very good

1 Like

Thanks @Andrej Podhajský. I literally took the neighbouring xpath with “Company” input element and used it and it worked. Thank you so much.

you are welcome, BTW good job how you describe your problem … was pleasure to look at it…

2 Likes

Thanks @Andrej Podhajský. Pleasure.

This should work.

forforum.jpg

Rustam Ismayilov said:

This should work.

good answer, but bit late, mate…

Thanks @Rustam Ismayilov and @Andrej Podhajský that worked for me.

Please share complete solution. How you have identified element in popup model window.

Thanks in advance.

Hari Garlapati