<?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 Latif sofuoğlu on Medium]]></title>
        <description><![CDATA[Stories by Latif sofuoğlu on Medium]]></description>
        <link>https://medium.com/@a.sofuoglu1?source=rss-b44a6b637651------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7ZJcPcRySjGB_lIX8ICKwA.jpeg</url>
            <title>Stories by Latif sofuoğlu on Medium</title>
            <link>https://medium.com/@a.sofuoglu1?source=rss-b44a6b637651------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 10:00:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a.sofuoglu1/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[Test Automation with Java Records: Enhancing Readability and Maintainability]]></title>
            <link>https://medium.com/@a.sofuoglu1/test-automation-with-java-records-enhancing-readability-and-maintainability-288b3cb4c149?source=rss-b44a6b637651------2</link>
            <guid isPermaLink="false">https://medium.com/p/288b3cb4c149</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Latif sofuoğlu]]></dc:creator>
            <pubDate>Thu, 22 Jun 2023 23:42:23 GMT</pubDate>
            <atom:updated>2023-06-22T23:42:23.844Z</atom:updated>
            <content:encoded><![CDATA[<p>In the realm of test automation, maintaining readable and concise code is crucial for efficiency and maintainability. Java, being a popular programming language for test automation, introduced a new feature called “records” starting from Java 14. Records provide a convenient way to define simple classes for holding immutable data. I will explain usage of Java records within a test automation framework, specifically focusing on using with TestNG data-provider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*fq-HSQMeQowOUEvNcczy9w.png" /><figcaption>Records are compact classes, which allow us to store immutable data with minimal syntax</figcaption></figure><blockquote>Java records are a new type of class introduced in Java 14 that simplifies the creation of simple data objects. By using the record keyword, Java automatically generates constructors, getters, equals(), hashCode(), and toString() methods based on the defined fields. This eliminates the need for writing repetitive boilerplate code, resulting in more concise and readable data objects.</blockquote><p>Integrating Java records into a test automation framework can bring several advantages:</p><ol><li><strong>Simplified Data Objects:</strong> Java records allow us to define data objects with just a few lines of code, reducing verbosity and enhancing readability. Fields and associated methods are automatically generated, providing easy access to data.</li><li><strong>Immutable Data:</strong> Records are designed to be immutable by default, ensuring the integrity of test data during test execution. Immutable data objects contribute to reliable and predictable test results.</li><li><strong>Enhanced Maintenance:</strong> As test scenarios evolve and data structures change, updating data objects becomes effortless with records. Adding or modifying fields requires minimal modifications, reducing the risk of introducing bugs during maintenance.</li></ol><blockquote>Lets see the usage of Records within an example ,you can define an enum that represents the different constant values and associate a record with each enum constant.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A5Y7vD9YKyAsgrWgIfJM4A.png" /><figcaption>Instead of directly using records within enums, you can define an enum that represents the different constant values and associate a record with each enum constant.</figcaption></figure><p>In this example, we define an enum UserType representing different types of users, such as ADMIN, GUEST, and CUSTOMER. Each enum constant is associated with a corresponding UserRecord instance.</p><p>You can access the associated UserRecord for each enum constant by defining a field userRecord and a getter method getUserRecord() within the enum. This way, you can retrieve the user record for a specific enum constant and use it within your code.</p><p>Here’s an example usage of the enum and its associated record:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*973Q5TDFwjq6Z3vJwsrCIw.png" /><figcaption>By combining enums and records in this way, you can associate structured data (records) with specific constants (enums) and leverage the benefits of both concepts in your code.</figcaption></figure><blockquote>And Let’s see the usage of Records with data-provider.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*NfLaYZcp8dWjfya678nCBw.png" /></figure><p>In this example, we have a TestNG test class TestNGDataProviderExample that includes a data provider method getUserTypes() and a test method testUserLogin().</p><p>The getUserTypes() method returns a 2D array of objects, where each row represents a user type from the UserType enum. TestNG will invoke the testUserLogin() method for each row of data provided by the data provider.</p><p>Within the testUserLogin() method, we receive a UserType object representing the user type. We can then retrieve the associated UserRecord using the getUserRecord() method and perform test actions using the user record.</p><p>To run this TestNG test class, make sure you have the TestNG library added to your project dependencies. TestNG will automatically invoke the testUserLogin() method for each row of data provided by the data provider.</p><p>The integration of records within Selenium-based test automation frameworks empowers testers to handle test data effortlessly, resulting in more robust and maintainable automation scripts.</p><p>Java records offer a powerful feature set that, when combined with an automation framework like Selenium, can streamline test automation efforts</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=288b3cb4c149" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom Test Exceptions in Java Selenium]]></title>
            <link>https://medium.com/@a.sofuoglu1/custom-test-exceptions-in-java-selenium-7a64e506fc80?source=rss-b44a6b637651------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a64e506fc80</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[test-automation]]></category>
            <dc:creator><![CDATA[Latif sofuoğlu]]></dc:creator>
            <pubDate>Fri, 09 Jun 2023 10:01:31 GMT</pubDate>
            <atom:updated>2023-06-09T10:01:31.127Z</atom:updated>
            <content:encoded><![CDATA[<h3>In the world of test automation, Java / Selenium is widely used for web application testing. As projects grow in complexity, it becomes crucial to handle exceptions effectively to improve the reliability and maintainability of automated tests. Lets explore the concept of custom test exceptions in Java Selenium.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*xEARmmpAnZkuECGB9O1Wjg.png" /></figure><blockquote><strong>What is the Exceptions:</strong> In Java/Selenium, exceptions are used to handle unexpected or erroneous situations that may occur during test execution. These exceptions help identify and handle issues such as element not found, timeout, invalid input, or assertion failures.</blockquote><p>By default, Selenium provides a set of built-in exceptions, such as NoSuchElementException, TimeoutException, or WebDriverException. While these exceptions cover many common scenarios, they may not fully address the unique requirements of your test scenarios. This is where custom test exceptions come into play.</p><p><strong>Custom Test Exceptions:</strong> Custom test exceptions in Java Selenium allow you to define your own exception classes tailored to specific situations encountered during test execution. These exceptions can be designed to provide more descriptive messages, capture additional context information, or trigger specific actions when thrown.</p><blockquote>By creating custom exceptions with meaningful names, you can make your test code more readable and self-explanatory. This helps in quickly identifying the nature of failures when reviewing test reports or logs.</blockquote><p>Let’s consider an example where you want to handle a custom exception for a login failure scenario. You can create a custom exception class called LoginFailedException:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*KfwzoDu1Mp7KlgEt06No8g.png" /></figure><p>In your test code, when a login failure occurs, you can throw this custom exception as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*YMyEJugbkyxYauH-apjOQQ.png" /></figure><blockquote>BONUS !!! <br>TestNG’s TextException is a powerful tool for handling and reporting test failures with precision. By utilizing TextException, you can capture and convey detailed failure information, attach custom error messages, and implement tailored error handling logic.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lxgEDCwo91KSGGiZ1f6vfA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a64e506fc80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Pesticide Paradox: Don’t Let Your Bugs Become Resistant!]]></title>
            <link>https://medium.com/@a.sofuoglu1/the-pesticide-paradox-dont-let-your-bugs-become-resistant-90090cba8b56?source=rss-b44a6b637651------2</link>
            <guid isPermaLink="false">https://medium.com/p/90090cba8b56</guid>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Latif sofuoğlu]]></dc:creator>
            <pubDate>Sun, 04 Jun 2023 08:02:32 GMT</pubDate>
            <atom:updated>2023-06-04T08:02:32.138Z</atom:updated>
            <content:encoded><![CDATA[<h3>When it comes to software testing, there’s a paradoxical phenomenon called the “Pesticide Paradox.” It’s a bit like using the same pesticide over and over again and expecting it to continue being effective against all the bugs. In the software testing, this means that if you keep using the same set of tests without updating them, they become less and less effective at catching new bugs.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*zoueUkR_vmKHQhFr_QHZmg.png" /><figcaption>The seven princibles of software testing</figcaption></figure><p>Imagine you have a beautiful garden, and you’ve been using the same pesticide to keep the bugs away successfully. However, over time, you start noticing that some bugs are no longer affected by the pesticide. They seem to have developed resistance to it. This happens because the bugs have adapted and evolved to survive the pesticide that once used to eliminate them.</p><blockquote>The same principle applies to software testing. If you keep running the same set of tests repeatedly, you may become blind to the new bugs that could be lurking in your software. The application evolves, new features are added, and changes are made. If your testing remains stagnant, you won’t be able to catch the new bugs that emerge.</blockquote><p>Let’s say you’re an SDET working on a mobile app. You have a set of test cases that cover the main functionalities, such as logging in, browsing products, and making purchases. You diligently run these tests every time there’s a new release, and they always pass with flying colors. You might think everything is perfect, and your app is bug-free. But here’s where the Pesticide Paradox sneaks in.</p><p>One day, the development team introduces a new feature that allows users to customize their profiles with avatars. The feature seems straightforward, and you assume it won’t affect the existing functionality. However, unbeknownst to you, this change introduces a subtle bug that causes the app to crash when a user tries to upload a certain type of image file as their avatar.</p><blockquote>Since your existing test cases don’t cover this new feature explicitly, they won’t catch the bug. By repeatedly using the same set of tests without updating them, you’re essentially using the same pesticide that no longer affects the newly evolved bugs.</blockquote><blockquote><strong>To avoid falling into the Pesticide Paradox trap, you need to evolve your testing approach. Here are a few strategies:</strong></blockquote><ol><li><strong>Review and Refresh Test Cases:</strong> Regularly review your test cases to ensure they remain relevant and up to date. And dont hesitate to remove cases from your regression suite , if you think they are not effcetive anymore.Consider new features, changes, and potential risks. Update your test suite accordingly to reflect the evolving nature of your software.</li><li><strong>Embrace Exploratory Testing:</strong> I think thats the most beneficial step for to avoid <strong>Pesticide Paradox , i</strong>ncorporate exploratory testing into your process. Instead of relying solely on scripted test cases, allocate time to explore the application and test different scenarios, looking for unexpected bugs or issues.</li><li><strong>Leverage User Feedback:</strong> Actively gather feedback from users, support teams, and stakeholders. User reports and observations can uncover issues that were not caught by your existing tests. This input can guide you in updating your test cases to cover critical scenarios.</li><li><strong>Emphasize Collaboration:</strong> Collaborate closely with developers and business analysts. Stay informed about upcoming changes, features, and updates. Engage in discussions to gain insights and understand potential areas of risk that need to be addressed in testing.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90090cba8b56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Risk-Based Approach in Test Automation]]></title>
            <link>https://medium.com/@a.sofuoglu1/risk-based-approach-in-test-automation-6e185482695c?source=rss-b44a6b637651------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e185482695c</guid>
            <category><![CDATA[istqb]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Latif sofuoğlu]]></dc:creator>
            <pubDate>Sun, 04 Jun 2023 07:41:19 GMT</pubDate>
            <atom:updated>2023-06-04T07:41:19.886Z</atom:updated>
            <content:encoded><![CDATA[<h3>In today’s fast-paced software development landscape, organizations face mounting pressure to deliver high-quality applications quickly. Test automation has emerged as a vital tool in ensuring the reliability and efficiency of software products. However, implementing test automation without a structured approach can result in inefficient test suites, inadequate coverage, and a waste of resources.</h3><p>A risk-based approach in test automation involves identifying, prioritizing, and mitigating the risks associated with software development and testing. It shifts the focus from testing everything to testing what matters most, based on the impact and likelihood of potential issues. By aligning test efforts with the most critical areas of the software, organizations can optimize their testing efforts and allocate resources effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*sS6P-PHbrMUwOl-PpfXSPg.png" /></figure><blockquote><strong>Benefits of a Risk-Based Approach in Test Automation</strong></blockquote><p><strong>Enhanced Test Coverage:</strong> Prioritizing tests based on risk helps ensure that critical functionalities and potential failure points are thoroughly tested. This approach provides better coverage and increases the chances of detecting high-impact issues early in the development cycle.</p><p><strong>Efficient Resource Utilization:</strong> By concentrating testing efforts on high-risk areas, organizations can allocate resources more efficiently. This saves time, effort, and costs associated with exhaustive testing, enabling teams to focus on critical areas and improve time-to-market.</p><p><strong>Early Defect Detection:</strong> A risk-based approach enables testers to identify and address potential risks earlier in the development lifecycle. Early detection of defects facilitates timely remediation, reducing the likelihood of costly rework and enhancing overall product quality.</p><p><strong>Improved Decision-Making: </strong>Risk assessment provides valuable insights for decision-making throughout the development process. Test automation teams can make informed choices regarding test design, test cases, and release readiness based on the identified risks, ensuring effective risk mitigation strategies.</p><h3>Best Practices for Implementing a Risk-Based Approach in Test Automation</h3><ol><li>Risk Identification and Prioritization: Begin by identifying the potential risks associated with the software under test. Collaborate with stakeholders, including business analysts, developers, and subject matter experts, to identify critical functionalities and failure scenarios. Prioritize risks based on their potential impact and likelihood of occurrence.</li><li>Test Strategy Alignment: Align the test strategy with the identified risks. Define test objectives, scope, and coverage based on the prioritized risks. Focus on testing critical business functionalities, areas prone to failure, and features with significant user impact.</li><li>Test Case Selection: Prioritize test cases based on their relevance to identified risks. Assign higher weightage to test cases covering critical functionalities and potential failure scenarios. Optimize test suite size by removing redundant or low-impact tests, ensuring efficiency in test execution and maintenance.</li><li>Test Automation Tool Selection: Choose a test automation tool that supports risk-based testing approaches. Look for features such as test case management, risk mapping, and reporting capabilities. The tool should provide flexibility to modify test suite composition based on changing risk profiles.</li><li>Continuous Risk Assessment: Regularly reassess risks throughout the development lifecycle. As the software evolves, new risks may emerge, and the significance of existing risks may change. Conduct risk assessments in collaboration with the development team to ensure that testing efforts remain aligned with the evolving risk landscape.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*KIuDW-kp_tQIwl3qqd-QLA.png" /></figure><blockquote>Implementing a risk-based approach in test automation offers numerous benefits, including enhanced test coverage, efficient resource utilization, early defect detection, and improved decision-making. By focusing testing efforts on critical areas, organizations can optimize their test automation efforts, mitigate risks effectively, and deliver high-quality software within shorter timeframes. To successfully adopt a risk-based approach, organizations must invest in proper risk identification, prioritize test cases based on</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e185482695c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced Test Management in TestNG with ITestContext and Test Dependencies]]></title>
            <link>https://medium.com/@a.sofuoglu1/advanced-test-management-in-testng-with-itestcontext-and-test-dependencies-f2e5a74e4b30?source=rss-b44a6b637651------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2e5a74e4b30</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[selenium]]></category>
            <dc:creator><![CDATA[Latif sofuoğlu]]></dc:creator>
            <pubDate>Sat, 03 Jun 2023 14:37:04 GMT</pubDate>
            <atom:updated>2023-06-03T14:37:04.652Z</atom:updated>
            <content:encoded><![CDATA[<h4>TestNG is a popular testing framework for Java that provides powerful features for test management and execution. Two essential components of TestNG, ITestContext and test dependencies, allow you to efficiently manage test configurations and control the order of test execution. Lets explore the usage of ITestContext and test dependencies in TestNG, showcasing their benefits and providing practical examples.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*wxFRfmpa_uUP3KQHa9Mzyw.png" /><figcaption>TestNG is a popular testing framework</figcaption></figure><p><strong>Understanding ITestContext:</strong> ITestContext is an interface provided by TestNG that allows you to access information about the current test run. It provides valuable context-specific data, such as test names, test parameters, test suite information, and more. By leveraging ITestContext, you can dynamically configure test cases based on the runtime context.</p><p><strong>Utilizing ITestContext in TestNG Tests:</strong> To use ITestContext in TestNG, you can implement it as a parameter in your test method or test class constructor. Here&#39;s an example that demonstrates the usage of ITestContext to retrieve and utilize test parameters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CbXgHGuEdex_5YwXCye7hQ.png" /></figure><p><strong>Managing Test Dependencies: </strong>Test dependencies in TestNG allow you to define the order of test execution, ensuring that specific tests run before others. This is particularly useful when one test case relies on the outcome of another. To define a test dependency, you can use the dependsOnMethods attribute in the @Test annotation. Here&#39;s an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*IcMniFbkNXo_BF17mmahPQ.png" /></figure><p><strong>Utilizing ITestContext with Test Dependencies:</strong> Combining ITestContext and test dependencies can provide even more flexibility in your test management. You can dynamically configure test dependencies based on the runtime context obtained from ITestContext. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*kijAxUeMB3sOQg7a1SBWFg.png" /></figure><blockquote>By leveraging ITestContext and test dependencies in TestNG, you can enhance your test management capabilities and exercise better control over test execution. ITestContext allows you to access and utilize runtime context-specific information, while test dependencies ensure a specific order of test execution. By mastering these features, you can write more sophisticated and efficient tests in TestNG.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2e5a74e4b30" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The most underrated feature of Cypress -cy.session-]]></title>
            <link>https://medium.com/@a.sofuoglu1/the-most-underrated-feature-of-cypress-cy-session-c4774529a8c8?source=rss-b44a6b637651------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4774529a8c8</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[cypress]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[qa]]></category>
            <dc:creator><![CDATA[Latif sofuoğlu]]></dc:creator>
            <pubDate>Sat, 03 Jun 2023 14:21:41 GMT</pubDate>
            <atom:updated>2023-06-03T14:21:41.829Z</atom:updated>
            <content:encoded><![CDATA[<h4>Cypress is a powerful end-to-end testing framework that allows you to write fast, reliable tests for web applications. One of the features that Cypress provides is cy.session(), which enables you to create reusable test setups and improve test execution efficiency. This article explores the usage of cy.session() in Cypress tests, highlighting its benefits and providing practical examples.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E2gryshgYXkdCzx-R2NFSg.png" /></figure><p><strong>Understanding </strong><strong><em>cy.session():</em></strong> cy.session() is a Cypress command that allows you to define and reuse a set of test steps as a session. It helps reduce code duplication by encapsulating common setup steps or sequences of actions that are required across multiple tests. With cy.session(), you can create a session once and use it in multiple test cases without having to repeat the setup code each time.</p><p><strong>Creating a Session:</strong> To create a session using cy.session(), you define a custom command that contains the desired setup steps or actions. For example, let&#39;s say you have a set of steps that involve logging in to the application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*lRngQrf6hTGEcKuXZH6kDA.png" /></figure><p><strong>Reusing a Session:</strong> Once you have defined the session, you can reuse it in different test cases by calling cy.session() and passing the custom command as an argument. Here&#39;s an example that demonstrates the reuse of the login session in multiple tests:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-1bjPxJF0VEfofAlH5VqhQ.png" /></figure><p><strong>Customizing Session Parameters:</strong> You can also customize session parameters by passing additional arguments to cy.session(). This allows you to modify the behavior of the session based on the specific requirements of each test case. For instance, you can pass parameters to the login session to simulate different user roles or scenarios:</p><blockquote>Conclusion: cy.session() in Cypress provides a convenient way to create reusable test setups and enhance test execution efficiency. By encapsulating common setup steps or sequences of actions in sessions, you can significantly reduce code duplication and make your tests more maintainable. Leveraging cy.session() empowers you to write cleaner and more efficient Cypress tests.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4774529a8c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing Test Organization with Context and Describe Blocks in Cypress/Mocha]]></title>
            <link>https://medium.com/@a.sofuoglu1/enhancing-test-organization-with-context-and-describe-blocks-in-cypress-mocha-8e08d4bff3d1?source=rss-b44a6b637651------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e08d4bff3d1</guid>
            <category><![CDATA[mocha]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[cypress]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[qa]]></category>
            <dc:creator><![CDATA[Latif sofuoğlu]]></dc:creator>
            <pubDate>Sat, 03 Jun 2023 14:08:52 GMT</pubDate>
            <atom:updated>2023-06-03T14:08:52.238Z</atom:updated>
            <content:encoded><![CDATA[<h4>When writing tests using Cypress and Mocha, organizing your test suite in a structured and meaningful way is crucial for maintainability and readability. Context and describe blocks are powerful features that help you achieve better organization and clarity in your test code. Lets see the usage of context and describe blocks in Cypress/Mocha, highlighting their benefits and providing practical examples.</h4><ol><li><strong>Understanding Context Blocks</strong>: Context blocks allow you to group tests based on a specific context or scenario. They provide a way to set up a common test environment or share setup steps among related tests. For example, imagine you are testing a user authentication feature. You can use a context block to define the setup steps required for different authentication scenarios:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S1wsyAcv4wXQsTCnf_iWSQ.png" /></figure><p>2. <strong>Leveraging Describe Blocks:</strong> Describe blocks are used to group related tests within a broader context. They provide a higher level of organization, allowing you to categorize tests based on specific functionality or feature. For instance, if you are testing a shopping cart functionality, you can use describe blocks to group tests related to adding items, removing items, and checking out:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nVMDhqxb_mUe7-8a7fLGtA.png" /></figure><p>3.<strong> Nesting Context and Describe Blocks:</strong> You can also nest context and describe blocks to create a hierarchical structure that reflects the relationships between different test scenarios. This allows for a more granular organization of your test suite. Here’s an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*UvW93UkG_DwCvpZL_nVjIw.png" /><figcaption>By using context and describe blocks in Cypress/Mocha, you can greatly enhance the organization and readability.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e08d4bff3d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Regular Expressions in Java Selenium Test Automation]]></title>
            <link>https://medium.com/@a.sofuoglu1/regular-expressions-in-java-selenium-test-automation-8ef6acc702a?source=rss-b44a6b637651------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ef6acc702a</guid>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[regular-expressions]]></category>
            <dc:creator><![CDATA[Latif sofuoğlu]]></dc:creator>
            <pubDate>Sat, 03 Jun 2023 13:58:21 GMT</pubDate>
            <atom:updated>2023-06-03T13:58:21.073Z</atom:updated>
            <content:encoded><![CDATA[<p>Regular expressions are powerful tools for pattern matching and manipulation of strings. In the context of Java Selenium test automation, regular expressions can be particularly useful when dealing with dynamic web elements, verifying text patterns, or extracting data from web pages. This article aims to provide you with a comprehensive understanding of the most commonly used regular expressions in Java Selenium test automation.</p><ol><li><strong>Matching Text Patterns:</strong> Regular expressions can be used to match specific patterns within strings, allowing you to verify expected text in web elements. For example, to validate an email address entered in a form, you can use the following regular expression:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*unNpP408cWscNbufAXR6tw.png" /></figure><p>2. <strong>Extracting Data:</strong> Regular expressions also enable you to extract data from web pages, such as retrieving a specific portion of a URL or extracting numbers from a string. For instance, if you want to extract the numeric portion from a product price displayed as “$99.99,” you can use the following regular expression:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*LPJ0St561l2UeSywcVO7zQ.png" /></figure><p>3. <strong>Handling Dynamic Elements: </strong>Web pages often contain dynamic elements with changing IDs, classes, or other attributes. Regular expressions can help identify and interact with such elements. For example, if the ID of a button changes dynamically but always starts with “btn_submit_”, you can locate it using a regular expression like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*o7JmWkFna3bkTvMlWy8jFA.png" /></figure><p>4. <strong>Replacing Text: </strong>Regular expressions allow you to replace or modify specific portions of text. This can be useful when updating dynamic content or removing unwanted characters. Suppose you want to remove all non-alphanumeric characters from a string. You can achieve this using the following regular expression:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*ymDWd7LELedxHyHTiS-J_g.png" /></figure><h4>Regular expressions are a valuable tool in Java Selenium test automation, enabling you to handle dynamic elements, validate text patterns, extract data, and manipulate strings effectively. By mastering the usage of regular expressions, you can enhance your automated tests, making them more robust and adaptable to changes in the application under test.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ef6acc702a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Calculating Work Days Between Two Dates in Java]]></title>
            <link>https://medium.com/@a.sofuoglu1/calculating-work-days-between-two-dates-in-java-aab1cc966d3?source=rss-b44a6b637651------2</link>
            <guid isPermaLink="false">https://medium.com/p/aab1cc966d3</guid>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[cypress]]></category>
            <dc:creator><![CDATA[Latif sofuoğlu]]></dc:creator>
            <pubDate>Sun, 28 May 2023 09:33:17 GMT</pubDate>
            <atom:updated>2023-05-28T09:33:17.696Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with date calculations, it is often necessary to determine the number of workdays (excluding weekends) between two given dates. This can be useful in various scenarios, such as calculating project durations or estimating delivery dates. In this article, we will explore a Java method that calculates the workdays between two dates.</p><p>Let’s take a closer look at that code snippet :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xxFtBXfW-H_FTB0qkEd6Q.png" /></figure><h3>Understanding the Code</h3><ol><li>We start by obtaining the day of the week for the start and end dates using the getDayOfWeek() method. This provides us with the DayOfWeek enum value representing the day of the week (e.g., MONDAY, TUESDAY, etc.).</li><li>We then calculate the total number of days between the start and end dates using the ChronoUnit.DAYS.between() method from the java.time.temporal package. This gives us the total count of days, including weekends.</li><li>Next, we calculate the number of days without weekends by subtracting twice the number of full weekends from the total days. We use integer division (days + startW.getValue()) / 7 to determine the number of full weekends present in the duration.</li><li>Finally, we add 1 to the count if the start or end date falls on a Sunday since it is not included in the daysWithoutWeekends calculation.</li></ol><h3>Usage Example</h3><p>Here’s an example of how you can use the getWorkDaysBetweenTwoDate() method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JC3Mvc4M9R2RsULy9F4Wbg.png" /></figure><h3>Result :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*28u7KCy-DIq1biA8lwIGoA.png" /></figure><h3>Conclusion</h3><p>Calculating the workdays between two dates is a common requirement in various applications. The provided code snippet offers a simple and efficient way to calculate this value by excluding weekends from the total duration. By utilizing the java.time package and the DayOfWeek enum, we can accurately determine the number of workdays between two dates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aab1cc966d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using YAML Files in Java Selenium Automation]]></title>
            <link>https://medium.com/@a.sofuoglu1/using-yaml-files-in-java-selenium-automation-f1570fc109f7?source=rss-b44a6b637651------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1570fc109f7</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[selenium]]></category>
            <dc:creator><![CDATA[Latif sofuoğlu]]></dc:creator>
            <pubDate>Sun, 28 May 2023 09:08:12 GMT</pubDate>
            <atom:updated>2023-05-28T09:08:12.739Z</atom:updated>
            <content:encoded><![CDATA[<p>It is common to have configuration files that store various settings and data in test automation. One popular format for such configuration files is YAML (YAML Ain’t Markup Language). YAML provides a human-readable and easy-to-write syntax, making it an ideal choice for storing test data and settings. In this article, we will explore how to use a YAML file in Java Selenium automation.</p><h3>YAML Dependency</h3><p>To start using YAML files in your Java Selenium project, you will need to add the appropriate dependency to your build configuration. You can use libraries such as SnakeYAML or Jackson YAML. For this example, let’s use SnakeYAML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*V3KnBlM6InIrbKdSfFi7ZQ.png" /></figure><h3>Loading YAML File</h3><p>Once you have added the dependency, you can start loading YAML files in your Java code. Here’s an example of how to load a YAML file using SnakeYAML:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*AZW1mOYpDTC0ELjkWxwoZg.png" /><figcaption>In this example, we use the Yaml class from SnakeYAML to load a YAML file named &quot;config.yml&quot;. We then access the values from the YAML file using the get method on the loaded Map object.</figcaption></figure><h3>YAML File Example</h3><p>Let’s assume our “config.yml” file looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*TDmRzdUlxI475gUP829CIw.png" /><figcaption>The Java code snippet shown earlier will load this YAML file and extract the values for “username” and “password” fields.</figcaption></figure><h3>Complex scenario</h3><p>Above one is very basic example of using .yml file but imagine you need to test an e-commerce website which needs to be running on lots of different markets like (Amazon ,ebay ,Avon…) , for sure you need a complex one like below sample</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*DZngolBspj3kpQWiMSaXUQ.png" /><figcaption>Here you can add tons of data for each different martkes easily</figcaption></figure><p>And definitely Using YAML files in Java Selenium automation helps in creating more maintainable and scalable test automation frameworks.</p><h3>Benefits of Using YAML Files</h3><p>Using YAML files in Java Selenium automation offers several benefits:</p><ul><li>Readable Syntax: YAML provides a human-readable and intuitive syntax, making it easy to write and understand test data and configuration settings.</li><li>Separation of Concerns: Storing test data and configuration settings in a separate YAML file promotes separation of concerns. Test code can focus on test logic, while YAML files handle data and configuration.</li><li>Flexibility: YAML supports nested structures, arrays, and key-value pairs, providing flexibility in structuring and organizing test data.</li><li>Easy Maintenance: With YAML files, it is straightforward to update and modify test data and configuration settings without changing the test code.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1570fc109f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>