Skip to Content
Menu
This question has been flagged
3 Replies
4563 Views

Hello,

I am using Odoo15, and I am trying to access the text content in the following XML code :



I have tried using //div/text() and also //div[contains(text(), 'On hand: ')] but that did not work. Can anyone help me?


Avatar
Discard
Best Answer

If you need to change the On hand string, try replacing the entire div

Avatar
Discard
Best Answer

xpath locating by text() (contents) breaks in translated context.

So you'll get the error "element cannot be located in the parent view".

Avatar
Discard
Best Answer

You can try this expr

expr="//*[text()='On hand: ']"

Avatar
Discard
Author

I get the following error when accessing the view :
" the element cannot be located in the parent view "

can you share your code ?

Related Posts Replies Views Activity
1
Apr 22
5631
3
Apr 21
7358
2
Jun 20
4841
1
Oct 19
4019
1
Mar 15
13062