Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3 Respostas
5061 Visualizações

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
Cancelar
Melhor resposta

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

Avatar
Cancelar
Melhor resposta

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

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

Avatar
Cancelar
Melhor resposta

You can try this expr

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

Avatar
Cancelar
Autor

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

can you share your code ?

Publicações relacionadas Respostas Visualizações Atividade
1
abr. 22
6301
3
abr. 21
8134
2
jun. 20
5460
1
out. 19
4429
1
mar. 15
13630