Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
5185 Vistas

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
Descartar
Mejor respuesta

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

Avatar
Descartar
Mejor respuesta

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

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

Avatar
Descartar
Mejor respuesta

You can try this expr

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

Avatar
Descartar
Autor

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

can you share your code ?

Publicaciones relacionadas Respuestas Vistas Actividad
1
abr 22
6644
3
abr 21
8362
2
jun 20
5619
1
oct 19
4594
1
mar 15
13804