डीप लिंक टेस्टिंग

Deep link ऐसा link है जो mobile app की start screen की बजाय उसके अंदर कोई खास screen खोलता है। Shipping email में https://shop.example.com/orders/A-1042 पर tap करने से shop app में order A-1042 दिखना चाहिए। Links users तक email, SMS, QR codes, push notifications और दूसरे apps से पहुँचते हैं, और हर link एक entry point है जो app की सामान्य navigation को छोड़ देता है।

Deep link testing जाँचती है कि ऐसा हर entry point user की हर संभव state में सही screen और सही data पर पहुँचाए: app installed है या नहीं, चल रहा है या बंद है, user signed in है, signed out है या किसी और के account से signed in है। यह उन mobile scenarios पर बनती है जो आप पहले से जानते हैं, और उनमें platform के वे नियम जोड़ती है जो तय करते हैं कि link app खोलेगा भी या नहीं।

यह क्यों ज़रूरी है

Deep links अहम पलों से जुड़े होते हैं: कोई campaign, password reset, delivery update। जब कोई link टूटता है तो failure चुपचाप होता है। User home screen पर पहुँचता है, "not found" कहने वाले web page पर, या इससे भी बुरा, किसी और के data पर, और team को support tickets से पता चलता है। कई कारण app के code से बाहर होते हैं: website पर कोई file, signing certificate, या email tool का जोड़ा हुआ redirect, इसलिए app के अंदर से शुरू होने वाले सामान्य UI tests इन्हें नहीं पकड़ते।

Deep link app के बाहर से आने वाला input भी है। कोई भी इसे बना सकता है, इसलिए app को इसे validate करना चाहिए, और सिर्फ़ इसलिए कि link ने कहा, कभी sign-in skip नहीं करना चाहिए या बिना confirmation कोई action नहीं करना चाहिए। Tester के लिए यह छोटा पर बहुत कीमती area है: जब आप जानते हैं कि कौन-सी states और platform rules मिलाने हैं, तो combinations का एक छोटा, सोच-समझकर चुना set असली risks cover कर लेता है।

Installed है या नहीं, signed in है या नहीं

एक ही link को कई states में टेस्ट करें, क्योंकि हर state अलग रास्ता लेती है। Installed नहीं: custom-scheme link fail होता है, जबकि verified https link उसी URL पर website खोलता है, इसलिए वह URL असली page होना चाहिए, बेहतर हो कि app पाने का रास्ता भी दे, कभी 404 नहीं। Installed पर verified नहीं: app होते हुए भी website खुलती है, जो गलत fingerprint या टूटी association file का आम संकेत है। पुराना version installed: अनजाने path पर app को crash होने की बजाय किसी समझदार screen पर fallback करना चाहिए।

App किस हाल में चल रहा है, यह भी मायने रखता है। App बंद हो तब आया link उसे शुरू से start करता है; background में हो या कोई दूसरी screen दिखा रहा हो तब आया link अलग code से गुज़रता है। दोनों टेस्ट करें, और देखें कि बाद में Back कहाँ ले जाता है।

फिर user। Signed out: sign-in screen आती है और sign-in सफल होने के बाद linked screen खुलती है, home screen नहीं। Owner के रूप में signed in: सही record खुलता है। किसी दूसरे user के रूप में signed in: साफ़ not-available message और owner का कोई data नहीं, जिसे server enforce करे, सिर्फ़ app न छिपाए। Session expired या install के बाद पहला launch: re-authentication, onboarding या permission prompt link को निगल न जाए।

आज़माएँ: पेयरवाइज़ टेस्टिंग जनरेटर

Links चलाना और verification जाँचना

Links उन channels से tap करें जो users सच में इस्तेमाल करते हैं: email app, SMS, कोई chat app, camera से scan किया QR code, push notification। कुछ apps links अपने in-app browser में खोलते हैं, जो उन्हें आपके app को शायद न सौंपे, और email click tracking अक्सर link को किसी दूसरे domain से होकर जाने वाले redirect में लपेट देती है जो आपके app से associated नहीं है। Link ठीक वैसे टेस्ट करें जैसे वह भेजा जाता है, ticket में लिखा साफ़ URL नहीं।

तेज़ और दोहराने लायक checks के लिए platform tools इस्तेमाल करें। Android पर adb link fire करता है और handler चुनना system पर छोड़ता है, और Android 12 से domain verification दिखाता और दोबारा चलाता है। iOS Simulator पर simctl URL खोलता है; असली iPhone पर link को Notes या Messages में paste करके tap करें।

# Android: fire the link and let the system choose the app (no package name)
adb shell am start -W -a android.intent.action.VIEW \
  -c android.intent.category.BROWSABLE \
  -d "https://shop.example.com/orders/A-1042"

# Android 12+: domain verification state, then a fresh verification
adb shell pm get-app-links com.example.shop
adb shell pm verify-app-links --re-verify com.example.shop

# iOS Simulator: open the link through the system
xcrun simctl openurl booted "https://shop.example.com/orders/A-1042"

आज़माएँ: रीडायरेक्ट चेकर

Worked example: shipping email में order link

Requirement: "Shipping email में order का link है। App हो तो link order details खोलता है; app न हो तो website पर order page।" Link https://shop.example.com/orders/A-1042 है और order सारा का है। शुरुआत चार true/false conditions पर बनी decision table से करें: installed, verified, signed in और owner। Table का हर column इन चार conditions का एक combination है, साथ में वह screen जिस पर link को पहुँचना चाहिए, और ये columns मुख्य cases देते हैं; decision table testing का lesson बताता है कि table कैसे बनाएँ और उन columns को कैसे merge करें जिनमें कोई condition नतीजा नहीं बदलती। फिर हर चीज़ को गुणा करने की बजाय सबसे ज़्यादा risk वाले columns में running-state और channel variations जोड़ें।

  • Installed, सारा signed in, app बंद: order A-1042 खुलता है, और Back तय किए मुताबिक orders list पर ले जाता है।
  • वही, app background में cart screen पर: order A-1042 खुलता है और cart नहीं बदलता।
  • Installed, signed out: sign-in screen आती है; सारा के sign in करने के बाद order A-1042 खुलता है, home screen नहीं।
  • Installed, कोई दूसरा user signed in: not-available message, A-1042 का कोई data नहीं, और API उस order की request ठुकरा देता है।
  • Installed नहीं: website पर order page खुलता है (web sign-in के बाद), store के link के साथ; कोई 404 नहीं।
  • assetlinks.json में न दी गई key से signed build: website खुलती है और pm get-app-links domain को verified नहीं दिखाता। इसे screen के नहीं, configuration के ख़िलाफ़ report करें।
  • अनजाना, खाली या बहुत लंबा id (/orders/A-9999, /orders/, 300 characters): साफ़ error screen, कोई crash नहीं।
  • असली email, उसके click-tracking redirect के साथ, हर supported email app में: साफ़ link जैसा ही result।

आज़माएँ: डिसीज़न टेबल जनरेटर आज़माएँ: टेस्ट केस जनरेटर

आम गलतियाँ

  • सिर्फ़ app installed और user signed in रखकर टेस्ट करना, यानी वही state जिसे developers पहले ही आज़मा चुके हैं।
  • Links सिर्फ़ app के package पर निशाना साधे adb से fire करना, या browser में type करना, जिससे platform की link handling bypass होती है या बदल जाती है; links वहीं tap करें जहाँ users करते हैं।
  • पहले verification जाँचे बिना "website खुल गई" को app defect के रूप में report करना; कारण आम तौर पर association file, fingerprint या कोई redirect होता है।
  • Sign-in के बाद home screen को pass मान लेना: user order चाहता था, इसलिए कहीं और पहुँचना failure है।
  • पुराने app versions भूल जाना, जिन्हें अब भी links मिलते हैं, और iOS पर मौजूदा association file भी।
  • Link parameters पर भरोसा करना: link कभी sign-in skip न करे, दूसरे user का data न दिखाए, और बिना confirmation भुगतान, delete या कुछ send न करे।

QA का नज़रिया

शुरुआत में ही deep link inventory माँगें: product जो भी link भेजता या print करता है, उसका URL pattern, target screen, fallback, और association files का owner कौन है। Developers और product owner के साथ तय करें कि link के बाद Back कहाँ ले जाए, अनजाने path पर क्या दिखे, और deferred deep linking scope में है या नहीं। Release checklist में दोनों association files का check जोड़ें, क्योंकि website का deploy app में बिना किसी बदलाव के links तोड़ सकता है।

Defect report में link ठीक वैसा लिखें जैसा भेजा गया, किस channel से tap हुआ, device, OS, app version और build, app installed, चल रहा या बंद था, कौन-सा user signed in था, और verification state। Security behaviour, जैसे sign-in bypass करने वाला link, सिर्फ़ उन apps में जाँचें जो आपकी team के हैं या जिन्हें टेस्ट करने की लिखित अनुमति है, और अपनी team के अपनाए MASVS platform-interaction requirements के अनुसार।

अभ्यास

Promotion SMS के लिए deep link tests design करें

आपका काम

एक shop नीचे वाला SMS भेजता है। Offers सबके लिए public हैं, लेकिन code सिर्फ़ signed-in user के cart पर लगाया जा सकता है, और offer user के link tap करने से पहले खत्म भी हो सकता है।

Test cases design करें: कौन-सी states मिलाएँगे, हर एक का expected result, और app को दोष देने से पहले कौन-से checks चलाएँगे।

सामग्री
SMS:
आपका 10% code इंतज़ार कर रहा है: https://shop.example.com/offers/ramadan?code=SAVE10

Rule:
App हो तो link offer screen खोलता है और code cart पर लगा देता है।
App न हो तो link website पर offer page खोलता है।
चरण
  1. States लिखें: installed या नहीं, verified या नहीं, app बंद या background में, user signed in या out।
  2. हर meaningful combination का expected result लिखें, code के साथ क्या होता है, यह भी।
  3. Invalid input जोड़ें: गायब, अनजाना या lower-case code, और खत्म हो चुका offer।
  4. वे checks लिखें जो configuration fault को app defect से अलग करते हैं।
मॉडल उत्तर दिखाएँ
मॉडल उत्तर

Installed और signed in, app बंद होने पर और फिर background में: offer screen खुलती है और cart में SAVE10 एक बार लगा दिखता है; link दोबारा tap करने पर वह दो बार नहीं लगता।

Installed, signed out: offer बिना sign-in के खुलता है, क्योंकि offers public हैं। Code लगाने पर sign-in माँगा जाता है, जिसके बाद code लगा होता है और user offer या cart पर लौटता है, home screen पर नहीं।

Installed नहीं: website पर offer page code के साथ खुलता है, app पाने के रास्ते के साथ; कोई 404 नहीं। Store install के बाद भी code बनाए रखना deferred deep linking है और उसकी अपनी requirement चाहिए।

Invalid input: code parameter न होना, अनजाना code, lower case में save10 (rules के अनुसार accept या reject) और खत्म हुआ offer, हर एक पर साफ़ message; गलत code कभी cart खाली नहीं करता।

Installed पर verified नहीं: app की बजाय website पर offer page खुलता है; यह configuration fault है, app defect नहीं। इस या किसी भी दूसरे failure के लिए app को दोष देने से पहले checks चलाएँ: link SMS app में tap करें, browser में नहीं; Android पर pm get-app-links चलाएँ; पक्का करें कि दोनों association files HTTPS पर बिना redirect के load होती हैं, iOS file /offers/* cover करती है और Android intent filter वह path declare करता है; और किसी link shortener में दूसरे domain से होकर जाने वाला redirect trace करें।

अक्सर पूछे जाने वाले सवाल

Deep link, App Link और Universal Link में क्या अंतर है?

Deep link कोई भी link है जो app में कोई खास जगह खोलता है। Android App Links और iOS Universal Links ऐसे deep links हैं जो सामान्य https URLs पर चलते हैं और जिनके domain को platform ने app के लिए verify किया है, इसलिए app installed हो तो app खुलता है, वरना website। shop:// जैसा custom-scheme link बिना इस verification वाला deep link है।

App installed होने पर भी link website क्यों खोलता है?

आम तौर पर इसलिए कि platform ने इस build के लिए domain verify नहीं किया: assetlinks.json का fingerprint signing key से match नहीं करता, कोई file गायब, invalid या redirect हो रही है, या domain intent filter या associated domains में नहीं है। iOS पर यह तब भी expected है जब URL Safari में type किया गया हो या उसी site के page पर tap हुआ हो। Report करने से पहले verification जाँचें।

क्या deep links emulators और simulators पर टेस्ट हो सकते हैं?

कई checks हाँ: adb Android emulator पर और xcrun simctl openurl iOS Simulator पर काम करते हैं। फिर भी असली channels के साथ असली devices पर कम से कम एक round रखें, जैसे email apps, in-app browsers, camera का QR scanner और store installs, क्योंकि ये वहाँ अलग व्यवहार करते हैं या सिर्फ़ वहीं होते हैं।

क्या deep link tests automate करने चाहिए?

Routing हाँ: UI test emulator या simulator पर हर link pattern खोलकर screen assert कर सकता है, जिससे हर build पर routing regressions पकड़े जाते हैं, और एक script हर website deploy के बाद दोनों association files fetch कर सकती है। Channel behaviour और not-installed path आम तौर पर manual रहते हैं और release या campaign से पहले चलते हैं।

संदर्भ

  • About App LinksAndroid Developers (Google)Android App Links: आपकी अपनी वेबसाइट के deep links जिन्हें सिस्टम Digital Asset Links फ़ाइल (assetlinks.json) से verify करता है, ताकि वे सीधे ऐप में खुलें।
  • Allowing apps and websites to link to your contentAppleApple प्लेटफ़ॉर्म पर universal links: सामान्य वेब लिंक जो ऐप इंस्टॉल होने पर — सिस्टम द्वारा आपकी वेबसाइट की एक फ़ाइल जाँचने के बाद — ऐप खोलते हैं, वरना वेबसाइट।
  • OWASP Mobile Application Security Testing Guide (MASTG)OWASP FoundationMASVS के साथ चलने वाला टेस्टिंग मैनुअल: मोबाइल ऐप सुरक्षा जाँचने की तकनीकें और टेस्ट केस।
  • OWASP Mobile Application Security Verification Standard (MASVS)OWASP Foundationमोबाइल ऐप के लिए OWASP की सुरक्षा आवश्यकताएँ, storage, cryptography, authentication, network और platform interaction जैसे नियंत्रण समूहों में।

Mutqan tools से अभ्यास करें

conditions और actions से decision table बनाएँ, सभी rule संयोजन जनरेट करें और असंभव संयोजनों को समेट दें।

टेस्ट डिज़ाइन

किसी URL को protocol, host, port, path, क्वेरी पैरामीटर, fragment और क्रेडेंशियल में तोड़ें।

वेब

JSON सिंटैक्स वैलिडेट करें और गलतियों की सटीक जगह के साथ सुधार के उपयोगी सुझाव पाएँ।

JSON और डेटा

रीडायरेक्ट चेन (301/302/307/308) ट्रेस करें और हर हॉप, स्टेटस तथा अंतिम URL देखें।

वेब

फ़ीचर के विवरण और फ़ील्ड सूची से संरचित टेस्ट केस (id, शीर्षक, पूर्व-शर्तें, स्टेप, अपेक्षित परिणाम, प्राथमिकता) जनरेट करें।

टेस्ट डिज़ाइन

और गहराई से

इस topic में आपकी प्रगति

QA रोडमैप का हिस्सा