<?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 Can Oklay on Medium]]></title>
        <description><![CDATA[Stories by Can Oklay on Medium]]></description>
        <link>https://medium.com/@canoklay?source=rss-3ddec3e64746------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fYwHsQJKXa1LRrv-0MqMpw.png</url>
            <title>Stories by Can Oklay on Medium</title>
            <link>https://medium.com/@canoklay?source=rss-3ddec3e64746------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:10:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@canoklay/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[Load Testing with Locust]]></title>
            <link>https://medium.com/@canoklay/load-testing-with-locust-407c7a8226c8?source=rss-3ddec3e64746------2</link>
            <guid isPermaLink="false">https://medium.com/p/407c7a8226c8</guid>
            <dc:creator><![CDATA[Can Oklay]]></dc:creator>
            <pubDate>Mon, 02 Mar 2026 10:08:43 GMT</pubDate>
            <atom:updated>2026-03-02T10:13:48.834Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D3-bxIIk71yKfjjEnzuyKg.jpeg" /></figure><p>Load testing is an essential practice for ensuring your web application can handle the stress of real-world traffic. While basic “hit this URL” scripts are easy, simulating real user behavior — browsing, adding items to a cart, checking out, and logging out — requires a more sophisticated tool.</p><p>Locust is a Python-based load testing tool that excels at this. It treats load testing as code, allowing you to define complex user flows with the flexibility of Python.</p><p>In this journey, we will dive deep into the core concepts of Locust — <strong>TaskSets, weights, lifecycles, and interrupts</strong> — using practical examples on the test site <a href="http://automationpractice.com/">http://automationpractice.com/.</a></p><h3>The Core Concepts: A Quick Glossary</h3><p>Before we look at the code, you need to understand the building blocks of a Locust simulation.</p><h3>1. User Types: User vs HttpUser</h3><ul><li><strong>User</strong>: The base class. It’s useful for testing non-HTTP systems or simply debugging logic (printing to the console) without making network requests.</li><li><strong>HttpUser</strong>: This is what you&#39;ll use 90% of the time. It inherits from User but adds a client attribute—a slightly modified requests.Session that reports success/failure statistics to the Locust master.</li></ul><h3>2. TaskSets &amp; SequentialTaskSet</h3><p>Real users don’t just hit random endpoints. They enter a “mode” of behavior.</p><ul><li><strong>TaskSet</strong>: A collection of tasks. Think of it as a &quot;mini-script&quot; inside your main user.</li><li><strong>SequentialTaskSet</strong>: A specialized TaskSet where tasks are executed in the exact order they are defined.</li></ul><h3>3. Tasks &amp; Weights</h3><ul><li><strong>@task</strong>: A decorator that tells Locust &quot;this method is a user action.&quot;</li><li><strong>Weights</strong>: You can assign numbers to tasks (e.g., @task(3)). A task with weight 3 is three times more likely to be picked than a task with weight 1.</li></ul><h3>4. Wait Time</h3><p>Real users pause to read.</p><ul><li><strong>wait_time = between(1, 5)</strong>: The user will sleep for a random duration between 1 and 5 seconds after every task.</li></ul><h3>5. Interrupt</h3><p>When a user enters a TaskSet, they are &quot;stuck&quot; there looping through those tasks. <strong>self.interrupt()</strong> is the command to stop the current TaskSet and return control to the parent User class to pick a new behavior.</p><h3>Scenario 1: Understanding The Lifecycle (Start, Stop, and Events)</h3><p>Locust offers powerful hooks to run code at specific times: global test start, user spawn (hatch), and task start.</p><p>In this example, we use the base User class to print logs instead of making HTTP requests. This helps us visualize the execution flow.</p><pre>import events<br>from locust import User, between, task, SequentialTaskSet, events<br><br># 1. Global Events: Run once per test run<br>@events.test_start.add_listener<br>def on_test_start(**kwargs):<br>    print(&quot;&gt;&gt;&gt; ON_TEST_START: The Load Test is Launching&quot;)<br>@events.test_stop.add_listener<br>def on_test_stop(**_kwargs):<br>    print(&quot;&gt;&gt;&gt; ON_TEST_STOP: The Load Test is Ending&quot;)<br><br># 2. A Sequential Task Flow<br>class SearchProduct(SequentialTaskSet):<br>    # Runs when a User enters this TaskSet<br>    def on_start(self):<br>        print(&quot;SearchProduct : Task execution started...&quot;)<br>    # Runs when a User leaves this TaskSet<br>    def on_stop(self):<br>        print(&quot;SearchProduct : Task execution completed...&quot;)<br>    @task<br>    def search_men_products(self):<br>        print(&quot;Searching men products...&quot;)<br>    @task<br>    def search_kids_products(self):<br>        print(&quot;Searching kids products...&quot;)<br>    @task<br>    def exit_task_execution(self):<br>        # Crucial: This breaks the loop and lets the user do something else<br>        self.interrupt()<br><br>class MyUser(User):<br>    wait_time = between(1, 2)<br>    tasks = [SearchProduct]<br>    # Runs when a specific simulated user is created<br>    def on_start(self):<br>        print(&quot;MyUser : Hatching New User...&quot;)<br>    # Runs when the user is killed (e.g., stopping the test)<br>    def on_stop(self):<br>        print(&quot;MyUser : Deleting User...&quot;)</pre><h3>Key Takeaways:</h3><ul><li><strong>Global vs. Local:</strong> test_start runs <strong>once</strong> when you click the Start button. MyUser.on_start runs <strong>thousands</strong> of times (once for every simulated user spawned).</li><li><strong>Sequential Execution:</strong> Because we used SequentialTaskSet, search_men_products will <em>always</em> run before search_kids_products.</li></ul><h3>Scenario 2: Managing Complex Flows with Weights</h3><p>In a real e-commerce scenario, users spend more time browsing than viewing the cart. We can simulate this using a <strong>Dictionary of Tasks</strong> with weights.</p><p>Here, we define two distinct behaviors: SearchProduct and ViewCart.</p><pre>from locust import User, between, task, SequentialTaskSet<br><br>class SearchProduct(SequentialTaskSet):<br>    @task<br>    def search_men_products(self):<br>        print(&quot;Searching men products...&quot;)<br>    @task<br>    def search_kids_products(self):<br>        print(&quot;Searching kids products...&quot;)<br>    @task<br>    def exit_task_execution(self):<br>        self.interrupt()<br><br>class ViewCart(SequentialTaskSet):<br>    @task<br>    def get_cart_items(self):<br>        print(&quot;Get all cart items...&quot;)<br>    @task<br>    def search_cart_item(self):<br>        print(&quot;Searching cart item...&quot;)<br>    @task<br>    def exit_task_execution(self):<br>        self.interrupt()<br><br>class MyUser(User):<br>    wait_time = between(1, 2)<br>    <br>    # The Dictionary approach for weights<br>    tasks = {<br>        SearchProduct: 4,<br>        ViewCart: 1<br>    }</pre><h3>How the Math Works:</h3><p>In MyUser, the tasks dictionary defines probabilities.</p><ul><li><strong>SearchProduct (4):</strong> Users are 4x more likely to pick this behavior.</li><li><strong>ViewCart (1):</strong> Users are less likely to pick this.</li></ul><p><strong>The Flow:</strong> The user spawns -&gt; Locust rolls a die -&gt; Picks SearchProduct (most likely) -&gt; Runs the search tasks -&gt; interrupt() fires -&gt; User returns to root -&gt; Locust rolls a die again.</p><h3>Scenario 3: Real HTTP Testing with Validation</h3><p>Now, let’s hit the actual website <a href="http://automationpractice.com/">http://automationpractice.com/.</a></p><p>We will use HttpUser to make network requests. We will also use <strong>catch_response=True</strong> to perform assertions. By default, Locust only marks 4xx or 5xx codes as failures. But sometimes, a 200 OK response contains an error message (like &quot;Out of Stock&quot;). We need to check the text content.</p><pre>from locust import User, between, task, SequentialTaskSet, HttpUser<br><br>class ViewCart(SequentialTaskSet):<br>    @task<br>    def get_all_cart_items(self):<br>        # verify=False prevents SSL errors on some test sites<br>        with self.client.get(&quot;/index.php?controller=order&quot;, catch_response=True) as response:<br>            <br>            # Custom Validation Logic<br>            if response.status_code != 200:<br>                response.failure(f&quot;Failed to get cart. Status: {response.status_code}&quot;)<br>            else:<br>                # We check if the HTML contains specific text expected on the cart page<br>                if &quot;Shopping-cart summary&quot; in response.text:<br>                    response.success()<br>                else:<br>                    response.failure(&quot;Page loaded, but &#39;Shopping-cart summary&#39; text not found!&quot;)<br><br>    @task<br>    def exit_navigation(self):<br>        self.interrupt()<br><br>class MyUser(HttpUser):<br>    # Set the target host here or in the CLI<br>    host = &quot;http://automationpractice.com&quot;<br>    wait_time = between(1, 2)<br>    tasks = [ViewCart]</pre><h3>Why this matters:</h3><p>If the server returns a “200 OK” maintenance page, a standard load test thinks everything is fine. The catch_response context manager allows you to peek inside the response text and mark the request as a failure if it doesn&#39;t contain the data you expect.</p><h3>Summary</h3><p>By combining these building blocks, you can create highly realistic load tests:</p><ul><li>Use <strong>SequentialTaskSet</strong> to model specific flows (like Checkout).</li><li>Use <strong>Weights</strong> in the main User class to mix those flows (80% browsing, 20% buying).</li><li>Use <strong>Lifecycle hooks</strong> (start/stop) for setup (logging in) and teardown.</li><li>Use <strong>catch_response</strong> to ensure your server isn&#39;t just returning empty 200 OK pages.</li></ul><p>Locust gives you the power of Python to ensure your application can handle the swarm.</p><p>See you on my next locust journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=407c7a8226c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maestro vs Appium]]></title>
            <link>https://medium.com/@canoklay/maestro-vs-appium-90e5a4d995b7?source=rss-3ddec3e64746------2</link>
            <guid isPermaLink="false">https://medium.com/p/90e5a4d995b7</guid>
            <dc:creator><![CDATA[Can Oklay]]></dc:creator>
            <pubDate>Wed, 20 Nov 2024 12:23:31 GMT</pubDate>
            <atom:updated>2024-11-20T12:30:01.938Z</atom:updated>
            <content:encoded><![CDATA[<p>Merhabalar,</p><p>Size yeni mobil UI otomasyon tool’u olan ve adından çok fazla bahsettiren Maestro’dan bahsedeceğim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*Mmq2fOkDF9AL4NBSWOb2-w.png" /></figure><p>Maestro, sürekli olarak performans ve kolay kullanım konusunda Appium ile karşılaştırılıyor. Bu yüzden işin aslını göstermek için size bu iki tool’un avantaj ve dezavantajlarından bahsedeceğim. Daha sonra ise Maestro’ya giriş yapacağız ve özelliklerini yakından inceleyeceğiz.</p><h3><strong>Maestro</strong></h3><p><strong>Avantajlar</strong></p><ul><li>Şu an open source ama ileride CI ile gerçek cihazlar üzerinde koşum özelliği gelirse ücretlendirebilirler.</li><li>Kolay syntax’ı sayesinde çok hızlı test yazılabiliyor.</li><li>Paralel koşum yapılabiliyor.</li><li>Kurulumu çok kolay.</li><li>Development maliyeti düşük.</li><li>Ürün hızlı gelişiyor ve gelecek vadediyor. Slack kanalı var ve kanal üzerinden geliştirme talebinde bulunulabiliyor.</li><li>Dependency’lere ve başka tool’lara bağlı değil.</li><li>Testlerin flaky’liğini önlüyor. UI elementleri AI yardımıyla handle ediliyor.</li><li>Ekipteki herkes Maestro ile test yazabilir.</li><li>Maestro cloud kullanarak CI’a entegre etmek kolay.</li></ul><p><strong>Dezavantajlar</strong></p><ul><li>Sadece emulator ile test koşumu yapılabiliyor. Gerçek cihazlarda koşulamıyor.</li><li>Yeni bir tool olduğu için bug olabilir. Maestro’nun kendisinde bir sorun yaşanırsa otomasyon geliştirmesinin durması gerekebilir ve fixlemelerini beklemek zorunda kalınabilir.</li><li>Raporlaması zayıf .</li><li>Sadece kendisinde olan metodlarla sınırlısınız. Custom metodlar yazılamıyor.</li><li>Community küçük.</li><li>Kompleks caseler yazılamaz.</li><li>Hata alındığında ayrıntı göstermiyor, debug edilemiyor.</li><li>Hata alınan adımda screenshot alınamıyor.</li><li>Çoğu zaman text ve point’ler ile element yakalamak gerekiyor.</li></ul><h3><strong>Appium</strong></h3><p><strong>Avantajlar</strong></p><ul><li>Paralel koşum yapılabiliyor.</li><li>Gerçek cihazlarda koşum yapılabiliyor.</li><li>Birden fazla dil desteği var. (Java, Python, Javascript, vb.)</li><li>Programlama dillerinin ve farklı tool’ların gücünü kullanarak daha kompleks ve custom metodlar yazılabiliyor.</li><li>UI ile birlikte API testleri de yapılabiliyor.</li><li>Open source.</li><li>Geniş bir community’e sahip.</li><li>Advanced özellikleri daha fazla.</li><li>Farklı tool’lar kullanılarak raporlama daha güçlü hale getirilebiliyor.</li></ul><p><strong>Dezavantajlar</strong></p><ul><li>Syntax’ı daha karışık.</li><li>Öğrenmek zaman alıyor.</li><li>Kurulumunu yapması uzun sürüyor.</li><li>Testler flaky olabiliyor.</li><li>Yazılım geliştirme temellerini iyi bilmek gerekiyor. (OOP, POM, etc.)</li><li>Selector’ler daha karışık.</li><li>Gerçek cihazlarla ve emulatorlerle CI için çoğunluğu ücretli olan ayrı bir ürüne ihtiyaç duyuyor.</li></ul><p>Biraz da syntaxlarını yakından inceleyelim.</p><p>Öncelikle Maestro her case’ini flow olarak adlandırıyor ve bu flowlar .yaml dosyası olarak çalışıyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t7C2-bcpiQipqrBzJVZoMQ.png" /></figure><ul><li>Uygulamayı ayağa kaldırma adımları ikisinde şu şekilde:</li></ul><h3><strong>Maestro</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*-27-Df4irPlJCIAZRUbHyA.png" /></figure><h3><strong>Appium</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UpxrcyBMzhNqV9mvDzFU8Q.png" /></figure><ul><li>Scroll adımları şu şekilde:</li></ul><h3><strong>Maestro</strong></h3><p>Sadece şu şekilde scroll yazarak yapabiliyorsunuz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*C9UGKMM9leF2-DzS_eaa-A.png" /></figure><p>Ya da element görünene kadar scroll yapılmasını istiyorsak da şu şekilde yazılıyor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*IzBiyzryd9sPL70jIZAacQ.png" /></figure><h3><strong>Appium</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*ghWj-307fxBkGa4z9w5tFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*w7hYhNdAEw15mx8NKlzZhQ.png" /></figure><ul><li>İki tool’da kullanılan tech stack şu şekilde:</li></ul><p><strong>Maestro Stack</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*mAUUHSqjmzT9Z2jfdb7ciA.png" /></figure><p><strong>Appium Stack</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*JR9e_G4QnFM2PLP2KVqNMA.png" /></figure><p>Bir sonraki yazımda Maestro’nun diğer özelliklerini ve POM yapısını inceleyeceğiz. Teşekkürler.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90e5a4d995b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[POSTMAN - II]]></title>
            <link>https://medium.com/productmafia/postman-ii-971282b7b2b?source=rss-3ddec3e64746------2</link>
            <guid isPermaLink="false">https://medium.com/p/971282b7b2b</guid>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[postman-collections]]></category>
            <category><![CDATA[api-test-automation]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Can Oklay]]></dc:creator>
            <pubDate>Mon, 01 Jun 2020 18:13:11 GMT</pubDate>
            <atom:updated>2020-06-01T18:13:11.634Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*HwYTun1vp2UdREe6frHvPg.png" /></figure><p>Merhabalar,</p><p>Bu yazımda bir <a href="https://medium.com/@canoklay/api-testi-ve-postman-c0165e9ad076"><strong><em>önceki</em></strong></a> Postman yazıma devam edeceğim. Postman’nin parametre oluşturma, collections, enviroment, test oluşturma ve runner özelliklerinden bahsedeceğim.</p><p><strong>Parametre Oluşturma</strong></p><p>Değişkenleri parametrelere atayarak, aynı request’i farklı datalarda yaratmamıza gerek kalmaz ve bu sayede yarattığımız parametreyi farklı enviroment’larda da kullanabiliriz. Bu da test otomasyonumuzda tekrardan kaçınmamızı sağlar.</p><p>Request parametreleri soru işareti ile başlar (?) ve devamında ‘Key=Value’ data formatında olur. Aşağıdaki örnek url’mizde “q” key, “radiohead” ise değerimizdir.</p><p><a href="http://www.google.com/search?q=radiohead">www.google.com/search?q=radiohead</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m44mI8J1CMU3ZB-qmeY-8w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*c6mIugFAgMNOVFvS3qo6ew.png" /></figure><p>Şimdi postman üzerinden devam edelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M17eHkbRwB0EA9OOejgi7A.png" /></figure><p>Gördüğünüz gibi url’mizi yapıştırdığımızda ve send dediğimizde key ve value oluştu. Url’nin geri kalınını da yazarak parametrelerini oluşturabiliriz ve daha sonra sağdaki bulk-edit’e tıklayarak oradaki bütün parametreleri kopyalayıp başka bir request’e yapıştırıp aynı parametreleri kullanabiliriz.</p><p>Url’mizi parametre haline getirmek istediğimizde öncelikle sağ üstteki göz simgesine tıklıyoruz. Orada enviroment ve globals çıkıyor. Globals’ın hizasındaki edit’e tıkladığımızda bütün enviroment’lar için kullanabileceğimiz parametreler oluşturabiliriz ya da enviroment oluşturup sadece o enviroment’da kullanabileceğimiz değişkenler oluşturabiliriz..</p><p>Yazının devamında bu url’leri kullancağım: <a href="https://jsonplaceholder.typicode.com/users">https://jsonplaceholder.typicode.com/users</a></p><p><a href="https://reqres.in/">https://reqres.in/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SRmLZTgEqOzc9Fs7mAJ_FQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9fx_Go2EnhIDxkMk4FxYGA.png" /></figure><p>Şimdi variable adını url yaptıktan sonra bunu kullanmak için iki süslü parantezin içine yazmamız gerekiyor. Request adresimiz bu şekilde olmalı {{url}}/users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fRGUlGR-GbiEEahHQXbXpA.png" /></figure><p><strong>Postman Testi Oluşturma</strong></p><p>Postman testleri hazır JavaScript kodlarıyla kontroller yapmamızı sağlar.</p><p>Teste tıklayıp daha sonra sağdaki ‘SNIPPETS’ listesinden hazır kodları seçebiliriz. Kodların içeriğini değiştirerek de istediğimiz kontrolleri yapabiliriz.</p><p>SNIPPETS listesinden ‘Status code: Code is 200’ ve ‘Response body: JSON value check’i seçelim. pm.expect kısmında jsonData.value.to.eql(100) olan yeri jsonData[2].username.to.eql(“Samantha”) olarak değiştirelim. Burada jsonData’ya verdiğimiz, bilginin indeksini, value ise neyi kontrol ettiğimizi (name, username vb.) ve eql() içerisine yazdığımız da value’nun içerisinde kontrol edeceğimiz bilgiyi gösterir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WqfA-Ilx0BdriBrf3bMiTg.png" /></figure><p>Bunları yazıp send dediğimizde aşağıdaki test result kısmında ikisinin de <strong>PASS</strong><em> </em>olduğunu görebiliriz.</p><p><strong>Collections</strong></p><p>Koleksiyonlar testlerimizi düzenli bir şekilde tutmamızı ve import — export özellikleriyle paylaşımı kolaylaştırır.</p><p>Sol üstteki ‘New’e tıklayarak ‘Collections’ı seçiyoruz. Adını verdikten sonra ‘Create’e tıklıyoruz. Bir önceki yaptığımız get request’ini de oluşturduğumuz collections’a save yaparak ekleyelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUOXF8qxW3QRk3fRCPBvtA.png" /></figure><p><strong>Collection Runner</strong></p><p>Collection’larımızı koşmamızı sağlar.</p><p>‘Iterations’ bölümüne testlerin kaç kere çalışmasını istediğimizi, ‘Delay’ bölümüne de iteration’lar arasındaki bekleme süresini giriyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-r3JGaIJ81BsHqvU6jp-gQ.png" /></figure><p>Run Postman_Medium dediğimizde de testlerimiz koşuyor ve aşağıdaki ekranda başarılı olup olmadığını kontrol edebiliyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YUZIIgnh79ijid66Em9ObQ.png" /></figure><p><strong>Enviroment</strong></p><p>Farklı enviroment’ların içerisinde farklı değişkenler oluşturup, bunları farklı requestler’de kullanabiliriz.</p><p>Yeni bir collection oluşturup bunun adını ‘Environment_Medium’ verdim. Bir get request oluşturdum. Sağdaki ‘Manage Enviroment’a tıklayıp ‘Add’e tıklıyoruz ve enviroment’ımıza isim veriyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*SHQ5nOf_E1DoGoEQOCirAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qVl2wba9Ee96zVW5W0HINw.png" /></figure><p>Bu enviroment’ı oluşturup içerisindeki url’yi kullandığımızda sonuç aşağıdaki gibi oluyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A3Zjp81e37_BtmTcTVcJWw.png" /></figure><p>Vakit ayırdığınız için teşekkürler.</p><p>Bir sonraki yazıda görüşmek üzere.</p><p>KAYNAKLAR</p><ul><li><a href="https://www.toolsqa.com/postman/environment-variables-in-postman/">What are Environment Variables in Postman and How to use them?</a></li><li><a href="https://www.toolsqa.com/postman/request-parameters-in-postman/">What are Request Parameters in Postman and How to use them?</a></li><li><a href="https://medium.com/@tugceakin/rest-api-testi-olu%C5%9Fturmaya-giri%C5%9F-693f208be0f5">Rest API ve Postman’e Giriş</a></li><li><a href="https://www.guru99.com/postman-tutorial.html">Postman Tutorial - How to use for API Testing?</a></li><li><a href="https://learning.postman.com/getting-started/">Getting Started</a></li><li><a href="https://www.youtube.com/channel/UCocudCGVb3MmhWQ1aoIgUQw">Postman</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=971282b7b2b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/productmafia/postman-ii-971282b7b2b">POSTMAN - II</a> was originally published in <a href="https://medium.com/productmafia">productmafia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API Testi ve POSTMAN]]></title>
            <link>https://medium.com/productmafia/api-testi-ve-postman-c0165e9ad076?source=rss-3ddec3e64746------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0165e9ad076</guid>
            <category><![CDATA[api-testing]]></category>
            <category><![CDATA[web-services]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Can Oklay]]></dc:creator>
            <pubDate>Thu, 28 May 2020 19:33:19 GMT</pubDate>
            <atom:updated>2020-05-28T19:48:05.478Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*HwYTun1vp2UdREe6frHvPg.png" /></figure><p>Merhaba, bugün size API testi ve POSTMAN’den bahseceğim.</p><p>Daha önceden API ve web servisler ile ilgili bir yazı yazmıştım. O yazıma buraya bıraktığım <a href="https://medium.com/@canoklay/api-ve-web-servisler-3eb734dd059f"><strong><em>linkten</em></strong></a> ulaşabilirsiniz.</p><p><strong>API testi nedir ve neden yapılmalıdır?</strong></p><p>API testi, API’lerin servislerle olan entegrasyonunun test edilmesidir. Geliştirmede büyük bir soruna neden olacak bir hatayı gözden kaçırırsak bu hatayı üretim ortamında ayıklamak daha zor olacaktır.</p><p>Yazılımcılar hatalı API oluşturabilirler ve her gün kullandığımız uygulamaların çoğu, birden fazla birbirine bağlı API’ye dayanmaktadır ve herhangi biri başarısız olursa o zaman uygulama çalışmayacaktır. Bu yüzden API’leri test etmemiz gerekmektedir. Aynı zamanda API testleri UI testlerin aksine dakikalar içerisinde bitebilir ve bu sayede kısa sürede bir çok hata tespit edilebilir.</p><p><strong>API test türleri</strong></p><p><em>Birim Testi: </em>Bireysel işlemin işlevselliğini test etmek için yapılır.</p><p><em>İşlevsel Test:</em> Birlikte test edilen birim test sonuçları bloğunu kullanarak daha geniş senaryoların işlevselliğini test etmek için yapılır.</p><p><em>Yük Testi:</em> Yük altında işlevselliği ve performansı test etmek için yapılır.</p><p><em>Çalışma Zamanı/Hata Algılama:</em> İstisnalar ve kaynak sızıntıları gibi sorunları tanımlayan bir uygulamayı izlemek için yapılır.</p><p><em>Güvenlik Testi:</em> API uygulamasının dış tehditlere karşı güvenli olmasını sağlamak için yapılır.</p><p><em>UI Testi:</em> Kullanıcı ara birimin her yönünün beklendiği gibi çalıştığından emin olmak için uçtan uca entegrasyon testlerinin bir parçası olarak yapılır.</p><p><em>Birlikte Çalışabilirlik ve WS Uyumluluk Testi:</em> SOAP API’leri için geçerli bir test türüdür.</p><p><em>Penetrasyon Testi:</em> Sızma testlerinde siber suçluların gerçek dünyada kullandığı yöntemler kullanılarak bir kurumun bilişim altyapısına sızılmaya ve ele geçirilmeye çalışılır.</p><p><em>Fuzz Testi:</em> Bir uygulamada zafiyet tespit edebilmek için uygulamaya rastgele veriler göndererek, uygulamanın farklı isteklere verdiği cevapları analiz etmek için yapılır.</p><p><strong>POSTMAN</strong></p><p>Postman bir API testi aracıdır ve hızlıca CI/CD (Continuous Integration/Continuous Delivery) pipeline’a entegre olabilir.</p><p>Postman,</p><ul><li>erişilebilirlik kolaylığı,</li><li>koleksiyon kullanımı ile test suitlerinin düzenli tutulması,</li><li>işbirliği için dosya paylaşımının kolay olması,</li><li>ortamların oluşturma özelliğinin olması ve böylelikle test tekrarına düşülmeyip aynı testi başka ortam için kullanabiliyor olmamız,</li><li>test oluşturma ile HTTP yanıt durumu kontrolü gibi kontrollerin yapılabiliyor olması,</li><li>runner özelliği ile testleri otomatize edip tekrarlı ve hızlı testler ile zaman kazandırması,</li><li>postman konsolu sayesinde hangi verilerin alındığını kontrol etmeye yardımcı olması ve testlerde hata ayıklamayı kolaylaştırması,</li><li>son olarak da sürekli entegrasyonu desteklediği için tercih edilir.</li></ul><p>Şimdi Postman üzerinden aşağıdaki iki url’yi kullanarak birkaç HTTP metodunu kullanmayı göstereceğim.</p><p><a href="https://jsonplaceholder.typicode.com/users">https://jsonplaceholder.typicode.com/users</a></p><p><a href="https://reqres.in/">https://reqres.in/</a></p><p><strong>GET methodu</strong></p><p>Kayıtlı bilgiyi almak için kullanılır ve request body’si bulunmaz.</p><p>Url bölümüne ilk url’mizi yapıştırıyoruz ve request’imizi GET yapıyoruz. Send dediğimizde aşağıda bilgilerin geldiğini görüyoruz. Sağda statü kodumuz ‘200’ olmalı. Onun yanında da zamanı ve büyüklüğünü görebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v1RNCJKQaqeZlQ6f4x8jSw.png" /></figure><p><strong>POST metodu</strong></p><p>Yeni bilgi yaratmak için kullanılır ve request body’si bulunur.</p><p>İkinci url’mize gittiğimizde orada POST — Create’e tıkladığımızda orada request’deki path’e tıklayalım ve oranın url’sini kopyalayıp url bölümümüze yapıştıralım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*qZ7hb9tqR4gOOCf1R0PviQ.png" /></figure><p>Body kısmına gelip raw’u seçelim ve aynı hizada sağda text yazan yeri JSON formata çekelim. Daha sonra yukarıda requestin altında gördüğümüz name ve job bilgilerinin bulunduğu JSON formatını body’e yapıştıralım. Ardından SEND’e tıklayarak aşağıda oluştuğunu görebiliriz. Statü kodunun ‘201’ olması gerekiyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HCehKeB8hIn2wytJv-r_9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hHucNGdUuE-yaQW7ggIZ8Q.png" /></figure><p><strong>PUT metodu</strong></p><p>Kayıtlı bir bilgili güncellemek için kullanılır. Request body’si vardır.</p><p>Önceki örneğin üzerinden gidecek olursak, request’i PUT yapıp, job kısmını ‘basketball player’ olarak değiştirip SEND’e tıkladığımızda updated olduğunu aşağıda görebiliriz. Statü kodunun ‘200’ geldiğini görebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v6iPnzfVJVcAGjhAP_2Eug.png" /></figure><p><strong>DELETE metodu</strong></p><p>Kayıtlı bir bilgiyi silmek için kullanılır. Request body’si olabilir fakat genellikle sadece URL içerisinde silinecek bilgiye ait id bilgisi gönderilerek işlem tamamlanmaktadır.</p><p>Url’nin sonuna süslü parantez içerisinde username’i verip SEND yaptığımızda silindiğini ve sağda statü kodunun ‘204 no content’ olduğunu görebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zc_TVNKCoyLEmEgOrpUpsQ.png" /></figure><p>Vakit ayırdığınız için teşekkürler. Bir sonraki yazımda collections, parametreler ve postman testi oluşturma ile devam edeceğim.</p><p>İyi günler.</p><p>KAYNAKLAR</p><ul><li><a href="https://medium.com/@tugceakin/rest-api-testi-olu%C5%9Fturmaya-giri%C5%9F-693f208be0f5">Rest API ve Postman’e Giriş</a></li><li><a href="https://ceaksan.com/tr/api-testing-ve-fake-apiler/">API Testing ve Fake API&#39;ler - ceaksan</a></li><li><a href="https://www.beyaz.net/tr/guvenlik/makaleler/penetrasyon_sizma_testi_nedir.html">Penetrasyon/Sızma Testi Nedir?</a></li><li><a href="https://www.guru99.com/postman-tutorial.html">Postman Tutorial - How to use for API Testing?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0165e9ad076" width="1" height="1" alt=""><hr><p><a href="https://medium.com/productmafia/api-testi-ve-postman-c0165e9ad076">API Testi ve POSTMAN</a> was originally published in <a href="https://medium.com/productmafia">productmafia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API ve Web Servisler]]></title>
            <link>https://medium.com/productmafia/api-ve-web-servisler-3eb734dd059f?source=rss-3ddec3e64746------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eb734dd059f</guid>
            <category><![CDATA[web-services]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Can Oklay]]></dc:creator>
            <pubDate>Sun, 17 May 2020 17:26:17 GMT</pubDate>
            <atom:updated>2020-05-17T17:26:17.679Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*FIRuieMegLK2fJ4DzTFDtg.png" /></figure><p>Selamlar,</p><p>İlk yazımda size API ve web servislerinden bahsedeceğim.</p><p>API(<strong>A</strong>-pplication <strong>P</strong>-rogramming <strong>I</strong>-nterface) kısaca X uygulamasının özelliklerini Y uygulamasında kullanabilmemizi sağlar. Web servis ise HTTP protokolü üzerinden diğer sistemlere XML , JSON , CSV gibi ortak biçimlerle veri alışverişini sağlar. Her web servis bir web API’dir, ancak web API’ler web servisi değildir. API’ler sunucu ya da veritabanı değildir. Uygulamaların, sunucular, veritabanı ve diğer uygulamalar ile arasındaki iletişimi yöneten kodlardır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zioMnmt55xpolEDkmcCicA.png" /></figure><p>Daha iyi anlaşılması için hayattan bir örnekle anlatalım.</p><p>Restorandaki bir menüyü düşünürsek, menünün içerisinde birçok yiyeceğin ve içeceğin olduğu listeler var ve bunların altında içerisinde nelerin olduğu yazan açıklama kısmı var. Bu listeden bir yemeği seçtiğimizde, garson bunu mutfağa iletir ve mutfak hazırladıktan sonra garson bunu bize sunar. Biz mutfakta nasıl hazırlandığını bilmeyiz ve ihtiyaç da duymayız. Bu örnekteki garsonu API olarak düşünebiliriz.</p><p>Restorandaki menü gibi yazılımcıların kullanabileceği API listeleri vardır. Yazılımcı, tam olarak API’nin ihtiyacı olan şeyi nasıl yaptığını bilmesine gerek yoktur. Sadece kendi uygulaması için uygun olup olmadığı ile ilgilenir. Ama verdiğimiz restoran örneğinden farklı olarak belki de şunu ekleyebiliriz, yazılımcı API’ye kendi verisini sağlamalıdır. Yani belki de mutfağına kendi getirdiğiniz birkaç ürünü verebildiğiniz bir restoran demek daha doğru olabilir.</p><p>Burada yemeğimizi sipariş ettiğimizde bir request göndermiş olduk ve garson(API) bunu mutfağa iletti. Mutfağın gönderdiği response’u da garson(API) bize getirdi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xvnkm2Muj7Vv2zsIKhZeQg.png" /></figure><p>Bu örnek bilgiye direkt olarak erişilebilen durumları anlatan senaryo. Peki seyahat acentesi gibi birden fazla havayolu ve otelle bağlantı kuran bir durumda nasıl çalışıyor bu sistem bir de ona bakalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7eoTbkMcKq2WCkSBvv0fKA.png" /></figure><p>Burada, sitenin birden fazla havayolu şirketi ve otelle iletişimi var. Seçtiğimiz havayolu şirketiyle iletişime geçecek ve hangi koltuğun boş olduğunu, bagaj hakkımızı ve yemek seçeneklerimizi sunacak. Biz seçimlerimizi yaptıktan sonra bunu şirkete iletecek ve fiyatlandırmayı yapıp bize sunacak. Daha sonra benzer işlemi oteller için de yapacak.</p><p><strong>Web Servis Nedir?</strong></p><p>Her web servis bir web API’dir, ancak web API’ler bir web servisi değildir dedik. Yani web API, web servislerini kapsar. Web servisler XML, SOAP, WSDL ve UDDI kullanırlar. XML veriyi etiketlemek için kullanılır, SOAP veriyi transfer etmek için kullanılır, WSDL uygun servisleri tanımlamak için kullanılır, UDDI ise hangi servislerin uygun olduğunu listelemek için kullanılır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*byka7Hk2PkWfy6HF3O6P6w.png" /></figure><p>Web servisleri kullanılırken HTTP metodları kullanılır. Yazılımların hangi dille veya teknolojiyle geliştirildiği farketmeksizin aralarındaki ver alışverişini sağlar.</p><p><strong>HTTP Metodları</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*ezDbse7Z2X1QFl4T61c8yw.png" /></figure><p>En çok kullanılan HTTP metodları şunlardır:</p><p><strong><em>GET — </em></strong>Kayıtlı veriyi almak için kullanılır. En çok kullanılan metodlardan biridir. Bookmark edilebilir ve aynı sorgu daha sonra tekrar kullanılabilir. Mesaj gövdesi yoktur.</p><p><strong><em>POST — </em></strong>Yeni bilgi göndererek bunu kaydetmeye yarar. Bu metodla istek parametreleri hem URL içinde hem de mesaj gövdesinde gönderilebilir.</p><p><strong><em>PUT — </em></strong>Kayıtlı bir veriyi güncellememizi sağlar ve güncelleyeceğiniz verinin id’sini gövdede vermeniz gerekir.</p><p><strong><em>DELETE —</em></strong> Kayıtlı bir veriyi silmenize yarar. Url içerisinde silinecek verinin id bilgisi verilerek yapılabilir.</p><p><strong>HTTP Durum Kodları</strong></p><p>Bu kodlar yapılan işlem ile ilgili bilgi vermek için kullanılır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HGW8I79adX2Up2CoB2xzbQ.png" /></figure><p><strong>Web Servis Yanıtları</strong></p><p>Bu yanıtlar JSON, XML, TEXT, HTML şeklinde olabilir. Bu yanıtların örnekleri aşağıdaki gibidir.</p><p><strong><em>XML</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*KHJwi2g94Vj4fXCyysG4lg.png" /></figure><p><strong><em>JSON</em></strong></p><p>XML’e alternatiftir ve Javascript tabanlıdır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*cbLlOC5AcYkXPEUKcVt78A.png" /></figure><p>Vakit ayırdığınız için teşekkürler. Sonraki yazılarda görüşmek üzere.</p><p>Kendinize iyi bakın.</p><p>KAYNAKLAR</p><ul><li><a href="https://www.zapgroup.com.tr/blogdetay/api-nedir">Web Tasarım | Web Yazılım</a></li><li><a href="https://medium.com/@tugceakin/rest-api-testi-olu%C5%9Fturmaya-giri%C5%9F-693f208be0f5">Rest API ve Postman’e Giriş</a></li><li><a href="https://www.howtogeek.com/343877/what-is-an-api/">What Is an API?</a></li><li><a href="https://tecniablog.wordpress.com/2018/07/10/que-son-los-web-services/">Qué son los Web Services</a></li><li><a href="http://www.onurarslan.org/web-service-nedir/">Web Service Nedir? - Onur Arslan</a></li><li><a href="https://medium.com/@mbilgil0/http-metotlar%C4%B1-http-request-methods-90d57d574dfa">HTTP Metotları ( Http Request Methods)</a></li><li><a href="http://denizsakli.com/http-request-methods-response-error-code/">HTTP REQUEST METHODS &amp; RESPONSE (HTTP İSTEK METOTLARI ve YANITLARI)</a></li><li><a href="https://medium.com/@semihsaydam/rest-assured-1-dcb304ffb3e8">Rest Assured-1</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eb734dd059f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/productmafia/api-ve-web-servisler-3eb734dd059f">API ve Web Servisler</a> was originally published in <a href="https://medium.com/productmafia">productmafia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>