0

I verify launched current activity if it's in browser or in app by comparing with current activity. activity = driverAppium.current_activity

And then I verify if activity matches with browser activity name e.g. org.chromium.browser...

But can I verify the http response on the webpage e.g. 200 or 404?

With above test always passes even though webpage didn't load or get null response.

Can I verify with current activity and response both?

Naman
  • 27,789
  • 26
  • 218
  • 353
user2661518
  • 2,677
  • 9
  • 42
  • 79

1 Answers1

0

There are two ways to do it what I can think of,

  1. UI prospect :

    • Capture the screenshot of the webview with 200 response. Let's call it expectedScreen.png
    • Capture the screenshot of the under test response(be it 200, 400 etc.). Lets call this finalScreen.png
    • Compare both the images to verify/assert.
  2. API prospect : Since the Activity suppose to be displayed shall never/rarely be changed depending on transitions between different activities on your application as designed, so verifying current activity is a less important check during the test. You can rather verify these using API calls and then(if you get proper response) look for presence of elements on screen accordingly.

Naman
  • 27,789
  • 26
  • 218
  • 353