<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by  Priyanshi Thakur on Medium]]></title>
        <description><![CDATA[Stories by  Priyanshi Thakur on Medium]]></description>
        <link>https://medium.com/@0101.priyanshi?source=rss-6052a0d7b935------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*CuPezpGJrzK4o5kH</url>
            <title>Stories by  Priyanshi Thakur on Medium</title>
            <link>https://medium.com/@0101.priyanshi?source=rss-6052a0d7b935------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:51:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0101.priyanshi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bubble Sort In Java]]></title>
            <link>https://medium.com/@0101.priyanshi/bubble-sort-in-java-ed5a2b83d36f?source=rss-6052a0d7b935------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed5a2b83d36f</guid>
            <dc:creator><![CDATA[ Priyanshi Thakur]]></dc:creator>
            <pubDate>Sun, 28 Apr 2024 11:10:26 GMT</pubDate>
            <atom:updated>2024-05-04T15:01:41.933Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_UG0GbXAa6b_LuDm087YLA.png" /></figure><p>Bubble Sort is the simplest technique to sort any array of given elements.</p><p>We apply the basic principle of comparing the adjacent pair of elements and then swapping them based on a condition.</p><p><strong>Algorithm of Bubble Sort -</strong></p><ul><li>The sorting takes place in different stages known as <strong>passes</strong>.</li><li>The number of passes are <strong>equal</strong> to the number of elements in the array.</li><li>In each pass, we go from left to right and <strong>compare</strong> the two <strong>adjacent</strong> elements, the swapping will be done in the following way -</li></ul><ol><li>If the first element is <strong>greater</strong> than the second element, then we swap the elements.</li><li>If the first element is <strong>less</strong> than or <strong>equal </strong>to the second element, then no swapping is done.</li></ol><ul><li>After all the comparisons and swapping in a single pass, the largest element comes at the correct index in the array. <strong>For Example — In the first pass, the largest element comes at the last index, In the second pass, the second largest element comes at the second largest index and so on.</strong></li><li>Also, in every pass, we use a <strong>flag</strong> variable which is initially set to <strong>false</strong>, if there is any swapping done, we set the flag value to <strong>true</strong>.</li><li>If after any pass, the value of flag is still false, we stop the process as the array is already sorted.</li></ul><p><strong>Visualisation of Bubble Sort -</strong></p><p>Consider the given array — <strong>7, 18, 9, 11, 3</strong></p><p><strong>Step 1</strong>: Initial Array 7, 18, 9, 11, 3</p><p><strong>Step 2</strong>: First Pass In the first pass, we compare adjacent elements and swap them if they are in the wrong order.</p><p>Comparison 1: 7 and 18 (no swap)</p><p>Comparison 2: 18 and 9 (swap)</p><p>Comparison 3: 18 and 11 (swap)</p><p>Comparison 4: 18 and 3 (swap)</p><p><strong>Array after first pass: 7, 9, 11, 3, 18</strong></p><p><strong>Step 3:</strong> Second Pass Now, we repeat the process for the remaining elements.</p><p>Comparison 1: 7 and 9 (no swap)</p><p>Comparison 2: 9 and 11 (no swap)</p><p>Comparison 3: 11 and 3 (swap)</p><p><strong>Array after second pass: 7, 9, 3, 11, 18</strong></p><p><strong>Step 4:</strong> Third Pass We repeat the process again.</p><p>Comparison 1: 7 and 9 (no swap)</p><p>Comparison 2: 9 and 3 (swap)</p><p><strong>Array after third pass: 7, 3, 9, 11, 18</strong></p><p><strong>Step 5:</strong> Fourth Pass Another repetition of the process.</p><p>Comparison 1: 7 and 3 (swap)</p><p><strong>Array after fourth pass: 3, 7, 9, 11, 18</strong></p><p><strong>Step 6:</strong> Fifth Pass (Final Pass) Since there are no more swaps needed, the array is sorted.</p><p><strong>Final sorted array: 3, 7, 9, 11, 18</strong></p><p>This is how the Bubble Sort algorithm sorts the given array step by step.</p><p><strong>Time Complexity — Quadratic O(n²)</strong></p><pre>public class BubbleSort {<br>    public static void bubbleSort(int[] arr) {<br>        int n = arr.length;<br>        boolean swapped;<br>        <br>        // Iterate through all elements<br>        for (int i = 0; i &lt; n - 1; i++) {<br>            swapped = false;<br>            <br>            // Last i elements are already sorted, so we don&#39;t need to check them<br>            for (int j = 0; j &lt; n - i - 1; j++) {<br>                // Swap if the current element is greater than the next element<br>                if (arr[j] &gt; arr[j + 1]) {<br>                    int temp = arr[j];<br>                    arr[j] = arr[j + 1];<br>                    arr[j + 1] = temp;<br>                    swapped = true;<br>                }<br>            }<br>            <br>            // If no swapping is done in this pass, the array is already sorted<br>            if (!swapped) {<br>                break;<br>            }<br>        }<br>    }<br><br>    public static void main(String[] args) {<br>        int[] arr = {64, 34, 25, 12, 22, 11, 90};<br>        <br>        System.out.println(&quot;Original array:&quot;);<br>        for (int num : arr) {<br>            System.out.print(num + &quot; &quot;);<br>        }<br>        <br>        bubbleSort(arr);<br>        <br>        System.out.println(&quot;\nSorted array:&quot;);<br>        for (int num : arr) {<br>            System.out.print(num + &quot; &quot;);<br>        }<br>    }<br>}</pre><ol><li><strong>Outer Loop (i):</strong> The outer loop controls the number of passes through the array. In each pass, the largest unsorted element (in ascending order) bubbles up to its correct position. After each pass, the last element becomes sorted, so we can reduce the length of the inner loop by 1 for subsequent passes.</li><li><strong>Inner Loop (j)</strong>: The inner loop iterates through the array from index 0 to 𝑛−𝑖−1<em>n</em>−<em>i</em>−1. Here’s why:</li></ol><ul><li>As the algorithm progresses through each pass (controlled by the outer loop), the last 𝑖<em>i</em> elements are already in their correct sorted positions.</li><li>So, in each pass, we don’t need to compare elements that are already sorted.</li><li>By reducing the length of the inner loop by <em>i</em>, we avoid unnecessary comparisons with the elements that are already in their correct positions.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed5a2b83d36f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Types of wait in Appium]]></title>
            <link>https://medium.com/@0101.priyanshi/types-of-wait-in-appium-0350730c91cc?source=rss-6052a0d7b935------2</link>
            <guid isPermaLink="false">https://medium.com/p/0350730c91cc</guid>
            <category><![CDATA[appium-wait]]></category>
            <category><![CDATA[implicit-wait]]></category>
            <category><![CDATA[fluent-wait]]></category>
            <category><![CDATA[selenium-waits]]></category>
            <category><![CDATA[explicit-wait]]></category>
            <dc:creator><![CDATA[ Priyanshi Thakur]]></dc:creator>
            <pubDate>Sat, 17 Feb 2024 19:04:13 GMT</pubDate>
            <atom:updated>2024-02-17T19:04:13.843Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*cCz-mZ3zfRGSBF0t.jpg" /></figure><p>In Appium, just like in Selenium, waits are essential for handling synchronisation issues when automating interactions with mobile applications. There are different types of waits available in Appium, which I’ll explain with examples in Java:</p><ol><li><strong>Implicit Wait:</strong> Implicit waits instruct the WebDriver to wait for a certain amount of time when trying to find an element. If the element is not immediately available, Appium will wait for the specified duration before throwing an error. Implicit waits are applied globally to all elements and work for the entire duration of the WebDriver instance.</li></ol><pre>import io.appium.java_client.AppiumDriver;<br>import io.appium.java_client.android.AndroidDriver;<br>import org.openqa.selenium.By;<br>import org.openqa.selenium.remote.DesiredCapabilities;<br><br>public class AppiumExample {<br><br>    public static void main(String[] args) {<br>        // Set up desired capabilities and initialize Appium driver<br>        DesiredCapabilities caps = new DesiredCapabilities();<br>        // Add desired capabilities for your mobile device<br>        caps.setCapability(&quot;platformName&quot;, &quot;Android&quot;);<br>        caps.setCapability(&quot;deviceName&quot;, &quot;your_device_name&quot;);<br>        caps.setCapability(&quot;app&quot;, &quot;path_to_your_app&quot;);<br><br>        AppiumDriver driver = new AndroidDriver(new URL(&quot;http://localhost:4723/wd/hub&quot;), caps);<br><br>        // Set implicit wait<br>        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);<br><br>        // Example usage<br>        WebElement element = driver.findElement(By.id(&quot;myElement&quot;));<br>    }<br>}</pre><p><strong>2. Explicit Wait:</strong> Explicit waits allow you to halt execution until a certain condition is met or the maximum timeout is reached. WebDriverWait, along with expected conditions, is commonly used for explicit waits.</p><pre>import io.appium.java_client.AppiumDriver;<br>import io.appium.java_client.android.AndroidDriver;<br>import org.openqa.selenium.By;<br>import org.openqa.selenium.WebElement;<br>import org.openqa.selenium.remote.DesiredCapabilities;<br>import org.openqa.selenium.support.ui.ExpectedConditions;<br>import org.openqa.selenium.support.ui.WebDriverWait;<br><br>public class AppiumExample {<br><br>    public static void main(String[] args) {<br>        // Set up desired capabilities and initialize Appium driver<br>        DesiredCapabilities caps = new DesiredCapabilities();<br>        // Add desired capabilities for your mobile device<br>        caps.setCapability(&quot;platformName&quot;, &quot;Android&quot;);<br>        caps.setCapability(&quot;deviceName&quot;, &quot;your_device_name&quot;);<br>        caps.setCapability(&quot;app&quot;, &quot;path_to_your_app&quot;);<br><br>        AppiumDriver driver = new AndroidDriver(new URL(&quot;http://localhost:4723/wd/hub&quot;), caps);<br><br>        // Example usage of explicit wait<br>        WebDriverWait wait = new WebDriverWait(driver, 10);<br>        WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(By.id(&quot;myElement&quot;)));<br>    }<br>}</pre><p>3. <strong>Fluent Wait</strong>: Fluent waits provide more flexibility than implicit and explicit waits by allowing you to define polling intervals and exceptions to ignore during the wait period. They wait for a condition to be true as well as a maximum timeout. FluentWait is used along with Wait and ExpectedConditions.</p><pre>import io.appium.java_client.AppiumDriver;<br>import io.appium.java_client.android.AndroidDriver;<br>import org.openqa.selenium.By;<br>import org.openqa.selenium.WebElement;<br>import org.openqa.selenium.remote.DesiredCapabilities;<br>import org.openqa.selenium.support.ui.ExpectedConditions;<br>import org.openqa.selenium.support.ui.FluentWait;<br>import org.openqa.selenium.support.ui.Wait;<br>import java.time.Duration;<br><br>public class AppiumExample {<br><br>    public static void main(String[] args) {<br>        // Set up desired capabilities and initialize Appium driver<br>        DesiredCapabilities caps = new DesiredCapabilities();<br>        // Add desired capabilities for your mobile device<br>        caps.setCapability(&quot;platformName&quot;, &quot;Android&quot;);<br>        caps.setCapability(&quot;deviceName&quot;, &quot;your_device_name&quot;);<br>        caps.setCapability(&quot;app&quot;, &quot;path_to_your_app&quot;);<br><br>        AppiumDriver driver = new AndroidDriver(new URL(&quot;http://localhost:4723/wd/hub&quot;), caps);<br><br>        // Example usage of fluent wait<br>        Wait&lt;WebDriver&gt; wait = new FluentWait&lt;&gt;(driver)<br>                .withTimeout(Duration.ofSeconds(10))<br>                .pollingEvery(Duration.ofSeconds(2))<br>                .ignoring(NoSuchElementException.class);<br><br>        WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(By.id(&quot;myElement&quot;)));<br>    }<br>}</pre><p>4. <strong>Static Wait/Hard Wait :</strong> A hard wait, sometimes also called a “static wait” or “thread sleep,” involves instructing the test script to pause execution for a specific duration, regardless of whether the condition being waited for is met or not. This approach is generally less preferred compared to dynamic waits like implicit or explicit waits because it introduces unnecessary delays and can lead to brittle tests, especially in cases where the actual condition is met before the specified duration elapses.</p><p>In Java, you can implement a hard wait using Thread.sleep() method:</p><pre>try {<br>    Thread.sleep(5000); // Pause execution for 5 seconds<br>} catch (InterruptedException e) {<br>    e.printStackTrace();<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0350730c91cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Request and Response in Charles Proxy Tool]]></title>
            <link>https://medium.com/@0101.priyanshi/request-and-response-in-charles-proxy-tool-3b42483318c2?source=rss-6052a0d7b935------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b42483318c2</guid>
            <dc:creator><![CDATA[ Priyanshi Thakur]]></dc:creator>
            <pubDate>Thu, 16 Nov 2023 15:46:02 GMT</pubDate>
            <atom:updated>2023-11-16T15:46:02.652Z</atom:updated>
            <content:encoded><![CDATA[<p>We know how to set up Charles from our earlier articles. We will now focus on checking any API’s request and response.</p><p>You must first begin recording calls by pressing the grey button located in the upper menu bar. You will see a number of API requests once you click that button and launch your application.</p><p>Start by expnading the API hosts under the Structure Section; specific API will be seen inside. Upon selecting that specific API, the request and answer will be displayed as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WIF-6or7rDOB7XZtVXYX8w.png" /></figure><p>Requests will be in the top area, with responses appearing below. Requests and responses can be shown in any format you wish, including Header, Text, Hex, JavaScript, JSON, JSON text, and Raw. By right-clicking on the specific API, you can even copy the request and response. You will then be able to save the request and response.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b42483318c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gherkin Lint Execution Errors]]></title>
            <link>https://medium.com/@0101.priyanshi/gherkin-lint-execution-errors-f992420f4a90?source=rss-6052a0d7b935------2</link>
            <guid isPermaLink="false">https://medium.com/p/f992420f4a90</guid>
            <category><![CDATA[gherkin]]></category>
            <dc:creator><![CDATA[ Priyanshi Thakur]]></dc:creator>
            <pubDate>Fri, 20 Jan 2023 15:00:12 GMT</pubDate>
            <atom:updated>2023-01-20T15:00:12.904Z</atom:updated>
            <content:encoded><![CDATA[<p>The following table contains examples of errors expected in the feature files while running lint for each gherkin lint rule defined inside the .gherkin lintrc file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HXrPoiD4CVxIwnlJl1wFkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kFU5SGWismpO0P5daEBE7g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f992420f4a90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gherkin Lint Rules And their meaning]]></title>
            <link>https://medium.com/@0101.priyanshi/gherkin-lint-rules-and-their-meaning-bab2e18fa208?source=rss-6052a0d7b935------2</link>
            <guid isPermaLink="false">https://medium.com/p/bab2e18fa208</guid>
            <category><![CDATA[gherkin]]></category>
            <category><![CDATA[linting]]></category>
            <dc:creator><![CDATA[ Priyanshi Thakur]]></dc:creator>
            <pubDate>Fri, 20 Jan 2023 14:37:50 GMT</pubDate>
            <atom:updated>2023-01-20T14:38:22.461Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>.Gherkin Lintrc file Rules And their meaning</strong></p><p>Following rules can be added in .gherkin-lintrc file. Their meanings are defined in the table below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*qWPF0TfCLWfHbaGo1YCIsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47rp3MNnHej-CtK7Fz3IDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhF3AohaPxMowUNV5ICv1Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bab2e18fa208" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Charles Proxy Setup in Simulator]]></title>
            <link>https://medium.com/simpplr/charles-proxy-setup-in-simulator-739737a05083?source=rss-6052a0d7b935------2</link>
            <guid isPermaLink="false">https://medium.com/p/739737a05083</guid>
            <category><![CDATA[simulator]]></category>
            <category><![CDATA[charles-proxy]]></category>
            <category><![CDATA[setup-guide]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[ Priyanshi Thakur]]></dc:creator>
            <pubDate>Fri, 20 Jan 2023 13:56:31 GMT</pubDate>
            <atom:updated>2024-02-29T10:56:01.333Z</atom:updated>
            <content:encoded><![CDATA[<p>Charles is a web proxy (<a href="https://www.charlesproxy.com/documentation/additional/http-proxy/">HTTP Proxy</a> / <a href="https://www.charlesproxy.com/documentation/additional/http-monitor/">HTTP Monitor</a>) that runs on your own computer. Your web browser (or any other Internet application) is then configured to access the Internet through Charles, and Charles is then able to record and display for you all of the data that is sent and received.</p><p>Below is a step by step guide to setup Charles Proxy in your simulators.</p><p><strong>iOS Simulator</strong></p><ol><li>Reset your simulator to make sure you don’t have old or bad certificates.</li><li>In Charles menu, go to: <em>Help -&gt; SSL Proxying</em>, and select <strong><em>Install Charles Root Certificate</em></strong><em> in iOS Simulators</em>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0MiRuidMj9_vEBVp3WHgkg.png" /></figure><p>3. Make sure you are listening for traffic on your computer. Go to the menu <em>Proxy</em> -&gt; <strong><em>macOS Proxy</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hGCqlROcxJxAmSORsLRvg.png" /></figure><p>4. In Charles, make sure you have <strong>SSL Proxying enabled</strong> for the URLs you want to examine. For that, go to the menu <strong><em>Proxy</em> -&gt; <em>SSL Proxying Settings</em></strong> and <em>Add</em> the URL you are interested in. You can use<strong> </strong>*<strong> </strong>to indicate a range of URLs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cWP0yk5FKjZwU7x_U1hI1A.png" /></figure><p>5. Make sure to restart Charles after adding URLs in your <em>SSL Proxying Settings.</em></p><p>6. If you haven’t already, click <strong><em>Start Recording</em></strong> which will be in black in the top menu to start listening for traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G3F8frjBLdElsIbCSzEBVg.png" /></figure><p>7. <strong>Run the app in the simulator</strong>. You should start seeing traffic! One way to confirm is by logging in to the app and searching for that particular network call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*obyHpqg2tn-LWDuCkMp80A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=739737a05083" width="1" height="1" alt=""><hr><p><a href="https://medium.com/simpplr/charles-proxy-setup-in-simulator-739737a05083">Charles Proxy Setup in Simulator</a> was originally published in <a href="https://medium.com/simpplr">Simpplr Inc</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Charles Proxy Setup in Emulator]]></title>
            <link>https://medium.com/@0101.priyanshi/charles-proxy-setup-in-emulator-54396b74fd5f?source=rss-6052a0d7b935------2</link>
            <guid isPermaLink="false">https://medium.com/p/54396b74fd5f</guid>
            <category><![CDATA[setup-guide]]></category>
            <category><![CDATA[emulator]]></category>
            <category><![CDATA[charles-proxy]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[ Priyanshi Thakur]]></dc:creator>
            <pubDate>Fri, 20 Jan 2023 13:54:11 GMT</pubDate>
            <atom:updated>2023-01-20T13:54:11.584Z</atom:updated>
            <content:encoded><![CDATA[<p>Charles is a web proxy (<a href="https://www.charlesproxy.com/documentation/additional/http-proxy/">HTTP Proxy</a> / <a href="https://www.charlesproxy.com/documentation/additional/http-monitor/">HTTP Monitor</a>) that runs on your own computer. Your web browser (or any other Internet application) is then configured to access the Internet through Charles, and Charles is then able to record and display for you all of the data that is sent and received.</p><p>Below is a step by step guide to setup Charles Proxy in your android emulator.</p><ol><li>In Charles menu, go to: <strong><em>Help -&gt; SSL Proxying</em></strong>, and select <strong><em>Install Charles Root Certificate on a Mobile Device or Remote Browser.</em></strong></li><li>Make Sure you explicitly <strong>trust this certificate from your settings</strong>.</li><li>Write down your <strong>local IP address</strong> with the port number next to it and the URL that appears in the window.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sCuWY3KORPCKwoZya_12Vw.png" /></figure><p>4. Go to your<strong> Emulator settings</strong> and click in the<strong> <em>Proxy</em> tab</strong>. Select <strong><em>Manual Configuration</em></strong> and as host name and port <strong>enter the IP address</strong> from step 3 and <strong>8888</strong> as default port number . Click <strong><em>Apply</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wRz2cW5EvD-tptFZKy-ORA.png" /></figure><p>5. Go to <strong>wifi settings</strong> in your device and then go to <strong>Advanced</strong> . Click on <strong>edit</strong> option and write the <strong>proxy</strong> <strong>hostname</strong> from step 3 and default port number as <strong>8888</strong>. Click on <strong>save</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*FIg46bR6UP5XBlO6enJ6Ug.png" /></figure><p>6. You will be prompted to <strong>allow access for the Emulator</strong>. Click <strong><em>Allow</em></strong>.</p><p>7. In your Emulator’s device settings, again go to the network preferences and search for <em>Cellular Networks</em> or <em>Mobile Network.</em> Tap on<em> </em><strong><em>Access Point Names</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*-v33SF79Tosat46RKFyxkg.png" /></figure><p>8. Tap on the <strong>plus sign to add a new APN</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*mquGr5eEfDvd5PnZC6E8XA.png" /></figure><p>9. Add new APN any name you want. Now set the <strong>APN</strong> field to <a href="http://epc.tmobile.com/"><em>epc.tmobile.com</em></a>, set the <strong>MMSC</strong> field to <a href="http://mms.msg.eng.t-mobile.com/mms/wapenc,"><em>http://mms.msg.eng.t-mobile.com/mms/wapenc</em>,</a> and make sure <strong>APN Type</strong> is set to <em>Not Set</em>. Also, don’t forget to set the <strong>Proxy</strong> field to your IP address for Charles, and the <strong>Port</strong> to <strong>8888</strong>. And click on <strong>save</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*cFmW4N5Bdc1kH6muF58AJg.png" /></figure><p>10. Turn airplane mode on and off so those changes take effect.</p><p>11. If you are using an<strong> Android version below Nougat</strong> you can skip this step . Create and <strong>add the following network security config file to your app</strong>.</p><p>Add a file <strong>res/xml/network_security_config.xml </strong>to your app:</p><p>1&lt;network-security-config&gt; 2 &lt;debug-overrides&gt; 3 &lt;trust-anchors&gt; 4 &lt;!-- Trust user added CAs while debuggable only --&gt; 5 &lt;certificates src=&quot;user&quot; /&gt; 6 &lt;/trust-anchors&gt; 7 &lt;/debug-overrides&gt; 8&lt;/network-security-config&gt;</p><p>Then add a <strong>reference to this file in your app’s manifest</strong>, as follows:</p><p>1&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; 2&lt;manifest ... &gt; 3 &lt;applicationandroid:networkSecurityConfig=&quot;@xml/network_security_config&quot; ... &gt; 4 ... 5 &lt;/application&gt; 6&lt;/manifest&gt;</p><p>12. In Charles, make sure you have SSL Proxying enabled for the URLs you want to examine. For that, go to the menu <em>Proxy</em> -&gt; <em>SSL Proxying Settings</em> and <em>Add</em> the URL you are interested in. You can use <strong>*</strong> to indicate a range of URLs. Under SSL <strong>Proxying Settings &gt; Enable SSL Proxying &gt; Add *</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cWP0yk5FKjZwU7x_U1hI1A.png" /></figure><p>13. If you haven’t already, click <strong><em>Start Recording</em></strong> in the top menu to start listening for traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G3F8frjBLdElsIbCSzEBVg.png" /></figure><p>14. Run the app in the emulator. You should start seeing traffic!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*obyHpqg2tn-LWDuCkMp80A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54396b74fd5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IMPLEMENTING GHERKIN LINT]]></title>
            <link>https://medium.com/@0101.priyanshi/implementing-gherkin-lint-a9646715155d?source=rss-6052a0d7b935------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9646715155d</guid>
            <category><![CDATA[gherkin]]></category>
            <dc:creator><![CDATA[ Priyanshi Thakur]]></dc:creator>
            <pubDate>Thu, 17 Nov 2022 07:38:46 GMT</pubDate>
            <atom:updated>2022-11-17T07:38:46.182Z</atom:updated>
            <content:encoded><![CDATA[<p>Gherkin is a language that developers use to define tests in Cucumber. Since this language uses plain English, it’s meant to describe use cases for a software system in a way that can be read and understood by almost anyone.</p><p>Lint is a check performed at source code to display the syntactical/stylistic and programming error. This helps in improving the code readability and maintaining the quality of code. A linter is great for identifying errors when you have declared standard rules. A linter analyses your code for stylistic and programming errors against the rules you have declared.</p><p>For Gherkin lint, a code check is performed for the feature files. If any part of your code breaks the standard rules, it can pose a problem. Of course, you can avoid this by overriding the defaults and adjusting/disabling rules for particular files.</p><p><strong>Here are the Steps to implement Gherkin Lint in BDD framework.</strong></p><ol><li><strong>Open pom.xml and add below attached plugins.</strong></li></ol><pre><br>&lt;profiles&gt;<br>&lt;profile&gt;<br>&lt;id&gt;local&lt;/id&gt;<br>&lt;dependencies&gt;<br>&lt;dependency&gt;<br>&lt;groupId&gt;com.github.eirslett&lt;/groupId&gt;<br>&lt;artifactId&gt;frontend-maven-plugin&lt;/artifactId&gt;<br>&lt;version&gt;1.12.0&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;/dependencies&gt;<br>&lt;build&gt;<br><br>&lt;plugins&gt;<br>&lt;plugin&gt;<br>&lt;groupId&gt;com.github.eirslett&lt;/groupId&gt;<br>&lt;artifactId&gt;frontend-maven-plugin&lt;/artifactId&gt;<br>&lt;version&gt;1.7.5&lt;/version&gt;<br>&lt;configuration&gt;<br>&lt;installDirectory&gt;node-dir&lt;/installDirectory&gt;<br>&lt;/configuration&gt;<br>&lt;executions&gt;<br>&lt;execution&gt;<br>&lt;id&gt;install node and npm&lt;/id&gt;<br>&lt;phase&gt;install&lt;/phase&gt;<br>&lt;goals&gt;<br>&lt;goal&gt;install-node-and-npm&lt;/goal&gt;<br>&lt;/goals&gt;<br>&lt;configuration&gt;<br>&lt;nodeVersion&gt;v12.18.0&lt;/nodeVersion&gt;<br>&lt;npmVersion&gt;6.14.4&lt;/npmVersion&gt;<br>&lt;/configuration&gt;<br>&lt;/execution&gt;<br>&lt;execution&gt;<br>&lt;id&gt;front-npm-install&lt;/id&gt;<br>&lt;phase&gt;install&lt;/phase&gt;<br>&lt;goals&gt;<br>&lt;goal&gt;npm&lt;/goal&gt;<br>&lt;/goals&gt;<br>&lt;configuration&gt;<br>&lt;arguments&gt;install&lt;/arguments&gt;<br>&lt;workingDirectory&gt;node-dir&lt;/workingDirectory&gt;<br>&lt;/configuration&gt;<br>&lt;/execution&gt;<br>&lt;/executions&gt;<br>&lt;/plugin&gt;<br>&lt;/plugins&gt;<br><br>&lt;/build&gt;<br>&lt;/profile&gt;<br>&lt;/profiles&gt;</pre><p>2.<strong> Create directory in project as mentioned in plugin named node-dir and add a package.json file to get gherkin-lint.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MS81nKmJQBOumHsFLg_6Xg.png" /></figure><p><strong>3. Open package.json file and add following :</strong></p><pre>{<br>&quot;dependencies&quot;: {<br>&quot;gherkin-lint&quot;: &quot;^4.2.2&quot;<br>}<br>}</pre><p>4. Run <strong>mvn clean install -P local </strong>on terminal<strong>. </strong>This command will install node, npm and gherkin-lint under node-dir directory. Gherkin-lint will be installed under node_modules.</p><p>5. <strong>Create .gherkin-lintrc file on same location where package.json file is created in the project.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*rWXdc9i6XjYdCfFJHHvUbQ.png" /></figure><p><strong>6. Open .gherkin-lintrc file and write all the desired rules, you wish to implement in your framework. For instance you can write the following</strong></p><pre>{<br>  &quot;no-files-without-scenarios&quot; : &quot;on&quot;,<br>  &quot;no-unnamed-features&quot;: &quot;on&quot;,<br>  &quot;no-unnamed-scenarios&quot;: &quot;on&quot;,<br>  &quot;no-dupe-scenario-names&quot;: [&quot;on&quot;, &quot;in-feature&quot;],<br>  &quot;no-dupe-feature-names&quot;: &quot;on&quot;,<br>  &quot;no-partially-commented-tag-lines&quot;: &quot;on&quot;,<br>  &quot;indentation&quot;: &quot;on&quot;,<br>  &quot;no-trailing-spaces&quot;: &quot;on&quot;,<br>  &quot;new-line-at-eof&quot;: [&quot;on&quot;, &quot;yes&quot;],<br>  &quot;no-multiple-empty-lines&quot;: &quot;on&quot;,<br>  &quot;no-empty-file&quot;: &quot;on&quot;,<br>  &quot;no-scenario-outlines-without-examples&quot;: &quot;on&quot;,<br>  &quot;name-length&quot;: [&quot;on&quot;, {&quot;Feature&quot;: 50}],<br>  &quot;use-and&quot;: &quot;on&quot;,<br>  &quot;keywords-in-logical-order&quot;: &quot;on&quot;,<br>  &quot;no-superfluous-tags&quot;: &quot;on&quot;,<br>  &quot;no-homogenous-tags&quot;: &quot;on&quot;,<br>  &quot;one-space-between-tags&quot;: &quot;on&quot;,<br>  &quot;no-unused-variables&quot;: &quot;on&quot;,<br>  &quot;no-background-only-scenario&quot;: &quot;on&quot;,<br>  &quot;no-empty-background&quot;: &quot;on&quot;,<br>  &quot;scenario-size&quot;: [&quot;on&quot;, { &quot;steps-length&quot;: {&quot;Background&quot;: 15, &quot;Scenario&quot;: 15}}]<br>}</pre><p>7. Open terminal and run the following command to check the errors in your code.</p><pre>./node-dir/node_modules/.bin/gherkin-lint -c ./.gherkin-lintrc ./path/to/folder/with/feature/files</pre><p><strong>If the above command does not work try below command</strong></p><pre>./node-dir/node_modules/.bin/gherkin-lint -c ./node-dir/.gherkin-lintrc ./path/to/folder/with/feature/files</pre><p>8. <strong>After execution this is what output looks like on terminal</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nTwAhddu-KgPnTw3eaw3dw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9646715155d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>