Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
3 Besvarelser
5179 Visninger

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
Kassér
Bedste svar

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

Avatar
Kassér
Bedste svar

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

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

Avatar
Kassér
Bedste svar

You can try this expr

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

Avatar
Kassér
Forfatter

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 Besvarelser Visninger Aktivitet
1
apr. 22
6638
3
apr. 21
8358
2
jun. 20
5616
1
okt. 19
4588
1
mar. 15
13789