Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
4798 Tampilan

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
Buang
Jawaban Terbai

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

Avatar
Buang
Jawaban Terbai

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

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

Avatar
Buang
Jawaban Terbai

You can try this expr

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

Avatar
Buang
Penulis

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

can you share your code ?

Post Terkait Replies Tampilan Aktivitas
1
Apr 22
5959
3
Apr 21
7699
2
Jun 20
5101
1
Okt 19
4207
1
Mar 15
13329