Cannot find elements when the selector is null - error in Katalon

yes it is not :frowning:

Let’s see if these guys can spot something.

@Dave_Evers @grylion54

Do you use ‘drag and drop’ of your TestObject from the OR into your TestCase? If so, can you do it again? I get the null message when I have done something to the object in the OR, so I’m just checking that.

And maybe add some more “detail” to your object in the OR, like “CensusYear”, instead of just “Year”. I’m just trying to remove possibilities from my mind.

And can you check that you have a statement pathway that is checked for the object and displays in the “Selected Locator” window. I forgot to do that one time (well, maybe a few times).

Hello,

I am not using drag and Drop,i just right click the object and use the path of the test object in the script.

As u mentioned,i have renamed the object now and this is the xpath details:

statement pathway that is checked for the object and displays in the “Selected Locator” window - can you please let me know how to do it? i am unable to spot it

1 Like

Do you know if the id attributes are dynamic or static?

And can you try the below pathway in your browser to see if it is unique?

//flexipage-field[@data-field-id="RecordReporting_Year_cField"]//lighting-formatted-text[@slot="output"]

id attribute doesnt seems dynamic

WebUI.waitForElementPresent(findTestObject(‘Object Repository/CALARM-5/CALARM-1372/Census Information/Page_SNFCC-0000041236 SNF Census Case Salesforce/lightning-formatted-text_Year’),5)

reporting_year = WebUI.getText(findTestObject(‘Object Repository/CALARM-5/CALARM-1372/Census Information/Page_SNFCC-0000041236 SNF Census Case Salesforce/lightning-formatted-text_Year’))
print returns blank

1 Like

I was reading up on Salesforce Lighting and the document link states that it uses Shadow DOM.

so you have to investigate that, for sure.

1 Like

let me try to look at it.Thank you but this issue is quite new for me.I have recently started using Katalon :slight_smile:

Hi @shri.lakshmi,
Following up on Mike’s Shadow DOM info check this out for a possible solution: Automation testing of Shadow DOM elements with Katalon Studio | Katalon Docs

sure ,i will look into it.Thanks!

i have checked this DOM elements but i am in doubt that which element should be the parent Object. :frowning: i dont see any shadow root in the HTML

@shri.lakshmi I think it’s time you spoke to the web page authors/developers. If there’s no iframe and no shadow DOM there’s something weird/crazy going on on that page. The code I gave you to try in the browser console should have returned reasonable values – and it didn’t.

If I had to guess, I’d say it’s shadow DOM and you just haven’t found it yet.

Hi @shri.lakshmi, this link might help: Shadow DOM

1 Like

Thank you…sure let me re-check this

Try this…

document.querySelectorAll("iframe").length

I should have had you try this yesterday. :blush:

image

:confounded: :exploding_head:

     

I’ll be shocked if there’s no shadow DOM on that page. And if there isn’t, I (and a few other people) are going to learn something new.