WebElementNotFoundException: Web element with id:


#1

Hello team,
I have an error as bellow:
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_Create instance/textarea_Add New Virtual Server_form-control ng-untouched ng-valid ng-dirty’ located by ‘By.xpath: (.//*[normalize-space(text()) and normalize-space(.)=‘Add New Virtual Server’])[1]/following::textarea[1]’ not found

This is Xpath :



image

This is HTML :



I tried Element not found exception.

I copy Xpath :
image
/html/body/app-root/app-pages/div/div/div/div/app-request-instance/div/div/div/div/div[2]/textarea

and edited on selected locator. error still as same :
com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_Create instance/textarea_Add New Virtual Server_form-control ng-untouched ng-valid ng-dirty’ located by ‘By.xpath: /html/body/app-root/app-pages/div/div/div/div/app-request-instance/div/div/div/div/div[2]/textarea’ not found

I still tried to edited method attributes with Xpath , i copy. But it is still not working.
Please help me fix this issue
Thank you


#2

Hai, i dont know if this is a common problem or not. Usually, if we do recording, elements that captured will contain messy xpath and couldn’t be used again(Not all, but like 30%).
For me, the solution is to edit the object by myself, and i usually use ‘Attributes’ not ‘XPath’ (you still can put xpath on attributes tho, so it’s a win win).
From your case, i think you can try to implement this


#3

And what about all the advice I gave in your other topic ?


#4

Hi Purbo,
I tried attributes :
image
Same error.
Caused by: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Page_Create instance/textarea_Add New Virtual Server_form-control ng-untouched ng-valid ng-dirty’ located by ‘By.xpath: //textarea[@placeholder = ‘Please enter reason’]’ not found

I tried many way. But it still doesn’t work.
Could you please suggest other way?


#5

Sorry HeleneB,
I tried many way but not working


#6

have you checked if the xpath is valid or not? try firefox add-ons ‘chropath’ to verify if the xpath above found or not on your web page


#7

I checked Xpath. It is valid. I checked both on Firefox (add-on chropath ) and chrome.

:sob::sob::sob::sob::sob::sob::sob:


#8

may i know how do you set the elements on Object repository?
maybe you can try using ‘Attributes’ and add your xpath there?

| xpath | equals | /html/body/…your xpath here | |


#9

Yep, I already tried Attributes and set Xpath as I mentioned above. :frowning: :frowning:

:frowning: :frowning: