1

When i swipe to next page and get page_source , I can't get last page_source content

That is I only can get current visible page_source

But I want to scrape lots of page, get only visible page source is low efficient

Any way to get invisible outside page_source in appium? I use python.

Thanks

Super-ilad
  • 101
  • 11

1 Answers1

0

Need to understand what page would you like to catch - native or webview? Try to get a page source for debugging - https://appium.io/docs/en/commands/session/source/ .

Maybe you need to switch a context to get a page source?

Here how I implemented context switching.

  1. In some Page Object files I keep Android (or iOS) contexts.

     ANDROID_CONTEXTS = {
         'webview': 'WEBVIEW_ru.myapp',
         'native': 'NATIVE_APP'
     }
    
  2. In some tests I switch context from Native to Webview.

     @allure.link(url='https://jira.project.tech/browse/TEST-1', name='TEST-1 - Fill payment form')
     @allure.title('Fill payment form')
     def test_card_standard_1_month(appdriver):
    
         Paywall(appdriver).press_one_month_button()
         PaymentsPage(appdriver).select_card_payment()
         PaymentsPage(appdriver).press_payment_button()
    
    
         appdriver.switch_to.context(ANDROID_CONTEXTS['webview'])
         Payform(appdriver).fill_and_submit_payoform()
    
         appdriver.switch_to.context(ANDROID_CONTEXTS['native'])
    
         assert SuccessPayment(appdriver).get_successful_payment_title_text() == 'Your subscription is successful!'
    

You can check all available contexts in your app. More info here -> http://appium.io/docs/en/commands/context/set-context/

Mikhail Barinov
  • 120
  • 1
  • 2
  • 10