Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
5208 Visualizzazioni

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
Abbandona
Risposta migliore

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

Avatar
Abbandona
Risposta migliore

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

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

Avatar
Abbandona
Risposta migliore

You can try this expr

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

Avatar
Abbandona
Autore

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

can you share your code ?

Post correlati Risposte Visualizzazioni Attività
1
apr 22
6657
3
apr 21
8387
2
giu 20
5661
1
ott 19
4615
1
mar 15
13824