Se rendre au contenu
Menu
Cette question a été signalée
3 Réponses
5210 Vues

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
Ignorer
Meilleure réponse

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

Avatar
Ignorer
Meilleure réponse

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

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

Avatar
Ignorer
Meilleure réponse

You can try this expr

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

Avatar
Ignorer
Auteur

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

can you share your code ?

Publications associées Réponses Vues Activité
1
avr. 22
6658
3
avr. 21
8387
2
juin 20
5661
1
oct. 19
4616
1
mars 15
13826