Android - Appium - Web source is not updated after performing action

Here is my steps to reproduce:
1 Open Chrome app on Android
2 Go to my_test_website
3 Invoke keyword: Get source
<android.widget.Textview … something>
<android.widget.LinearLayout resource-id=“show-more”>
4 Locate the show-more element and perform “click element” action
5 Try to locate the elements expanding from “show-more” button but failed

The problem is: After clicking show-more button, it expands the hidden elements and these new elements are not updating to web source, that is why I failed at step5.

The web source after clicking show-more button should be:
<android.widget.Textview … something>
<android.widget.LinearLayout resource-id=“show-more”>
<android.widget.Textview … some_new_elements>

Does anyone resolve this issue on Android?
Very appreciate your help

You have to inspect/Get Source of the element after a change in the page (after action in step 4).

Hi HelioGuilHerme66,
The action at step 4 is clicking the button “show more” on the top right of image
Then at step 5, I try to locate the element ISP to get text “Amazon inc” but it failed.
Screen Shot 2022-08-23 at 08.35.25

The problem is these elements contained in “Show more” button are not appended to the Web page source.

Already invoke “get source” after step 4, but the source is the same at step 3 instead of updating new elements

Maybe that content is inside an iframe.

Can’t you try to open in a PC browser, with mobile emulation?

Sorry, but I can’t think in more hypothesis.

Hi HelioGuilherme66,

I already tried with mobile emulator and real mobile (android), but both had same result → Unable to update new elements in web source after clicking “Show more” button

I switched to Firefox app on Android (emulator and real device) and could locate these elements easily, they appeared in source right after I clicked “Show more” button

I think it could be a bug in Chrome app

1 Like