Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
5186 Widoki

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?


Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

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

Awatar
Odrzuć
Najlepsza odpowiedź

You can try this expr

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

Awatar
Odrzuć
Autor

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

can you share your code ?

Powiązane posty Odpowiedzi Widoki Czynność
1
kwi 22
6644
3
kwi 21
8362
2
cze 20
5619
1
paź 19
4594
1
mar 15
13804