Unable to Click on Salesforce Lightning Web element

Hi,

I have this test for Salesforce Lightning Test-

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘https://uat.lightning.force.com%252Flightning%252Fpage%252Fhome’)

WebUI.setText(findTestObject(‘Object Repository/Delta Credit/Page_Login Salesforce/input_Username_username’), ‘rahanuma.progga@consultant.kkr.com’)

WebUI.setEncryptedText(findTestObject(‘Object Repository/Delta Credit/Page_Login Salesforce/input_Password_pw’), ‘1LocSWEqcFbw7wd9q1G7sg==’)

WebUI.click(findTestObject(‘Object Repository/Delta Credit/Page_Login Salesforce/input_Password_Login’))

WebUI.delay(30)

WebUI.waitForElementVisible(findTestObject(‘Object repository/Delta Credit/Page_HomeSalesforce/span_Relationships’), 30)

WebUI.delay(30)

WebUI.click(findTestObject(‘Object repository/Delta Credit/Page_HomeSalesforce/span_Relationships’))

But I’m getting this error - Caused by: java.lang.IllegalArgumentException: Object is null

Here I’m trying to click on the span_Relationships element but in Test it’s actually throwing this error just after it launched the Homepage.

Looking forward for help.

Thanks,
Raha

How about taking a look at the xpath that you have to the span_Relationships element? It seems that the path is not valid and therefore you get a null.

Another thing is to fix the URL (if it looks like you have copied above):
WebUI.navigateToUrl('https://uat.lightning.force.com/lightning/page/home')

Actually, you may have to double slash every single slash so it looks like:
WebUI.navigateToUrl('https:///uat.lightning.force.com//lightning//page//home')

And you may opt for hitting CTRL + SHIFT + o to lessen the mismatch of import statements you have–Mobile, Web Services and Web.