<?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 Diyorbek Mamadaliev on Medium]]></title>
        <description><![CDATA[Stories by Diyorbek Mamadaliev on Medium]]></description>
        <link>https://medium.com/@diyorbekmamadaliev?source=rss-d3b6f7959c1f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uU4VMZbtdjXh8SNPgTnaHw.png</url>
            <title>Stories by Diyorbek Mamadaliev on Medium</title>
            <link>https://medium.com/@diyorbekmamadaliev?source=rss-d3b6f7959c1f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:51:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@diyorbekmamadaliev/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[What is SOP in Hospitality and How to Write the Best One]]></title>
            <link>https://diyorbekmamadaliev.medium.com/what-is-sop-in-hospitality-and-how-to-write-the-best-one-2d425938ab4a?source=rss-d3b6f7959c1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d425938ab4a</guid>
            <category><![CDATA[management]]></category>
            <category><![CDATA[restaurant]]></category>
            <category><![CDATA[tourism]]></category>
            <category><![CDATA[hospitality]]></category>
            <category><![CDATA[travel]]></category>
            <dc:creator><![CDATA[Diyorbek Mamadaliev]]></dc:creator>
            <pubDate>Wed, 20 Aug 2025 08:12:58 GMT</pubDate>
            <atom:updated>2025-08-20T08:12:58.835Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is SOP in Hospitality and How to Write the Best One</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*P4lWigeZCGj6Hd2W2gA4Yw.png" /></figure><p>In the world of hospitality, every detail matters. From the way a guest is greeted at the front desk to how a cup of coffee is served in the lounge, consistency is what separates an average experience from a memorable one. Behind this consistency lies one essential tool: the Standard Operating Procedure (SOP).</p><p>Whether you’re managing a five-star hotel, a cozy boutique property, or a bustling restaurant, SOPs act as the backbone of daily operations. But what exactly is an SOP in hospitality, and how can you write one that works effectively? Let’s dive in.</p><p><strong>What is an SOP in Hospitality?</strong></p><p>An SOP (Standard Operating Procedure) in hospitality is a step-by-step guide that outlines how specific tasks should be performed. It is designed to ensure consistency, efficiency, and quality across all areas of service.</p><p>Think of SOPs as the “rulebook” that staff members can rely on. For example:</p><ul><li>Housekeeping SOP: How to clean and set up a guest room, down to the placement of amenities.</li><li>Front Desk SOP: How to check in a guest, verify IDs, process payments, and upsell services.</li><li>F&amp;B SOP: How to serve wine, handle dietary requests, or set a dining table.</li></ul><p>In short, SOPs standardize service delivery so guests receive the same high-quality experience regardless of who is on duty.</p><p><strong>Why Are SOPs Important in Hospitality?</strong></p><ol><li>Consistency in Service — Guests expect the same level of service every time they visit. SOPs ensure that no matter who handles the task, the process remains the same.</li><li>Efficiency and Speed — Staff spend less time figuring things out on their own, which improves overall workflow.</li><li>Training and Onboarding — New employees can learn faster with clear written procedures, reducing the learning curve.</li><li>Accountability — When roles and steps are clearly defined, it’s easier to measure performance and maintain quality.</li><li>Guest Satisfaction — Ultimately, SOPs contribute to a seamless guest experience, which leads to loyalty and positive reviews.</li></ol><p><strong>How to Write the Best SOP for Hospitality</strong></p><p>Writing an SOP is more than just putting steps on paper — it’s about creating a practical guide that staff can easily understand and follow. Here’s a step-by-step method:</p><p><strong>1. Identify the Task</strong></p><p>Choose the process that needs to be standardized. For example:</p><ul><li>Handling a guest check-in.</li><li>Preparing a room service order.</li><li>Responding to guest complaints.</li></ul><p>Focus on one procedure at a time.</p><p><strong>2. Define the Objective</strong></p><p>Ask yourself: What do I want the SOP to achieve?</p><p>For example:</p><ul><li>Objective: Ensure all guests are checked in within 5 minutes while providing a warm and professional experience.</li></ul><p>This gives direction to your SOP.</p><p><strong>3. Break Down the Steps Clearly</strong></p><p>Write each step in simple, concise language. Avoid jargon unless it’s common in the workplace.</p><p>Example — Guest Check-in SOP:</p><ol><li>Greet the guest with a smile and eye contact.</li><li>Confirm reservation details.</li><li>Request ID and process payment.</li><li>Offer upgrades or promotions if available.</li><li>Provide key card and explain hotel amenities.</li><li>Wish the guest an enjoyable stay.</li></ol><p><strong>4. Use Visual Aids if Possible</strong></p><p>Diagrams, flowcharts, or checklists make SOPs more user-friendly, especially for tasks like housekeeping setups or table arrangements.</p><p><strong>5. Assign Responsibilities</strong></p><p>Clearly state who is responsible for each step. For example, the front desk agent handles check-in, while the concierge provides additional information about local attractions.</p><p><strong>6. Keep it Practical and Realistic</strong></p><p>Your SOP should reflect the actual workflow, not an idealized version that’s hard to follow in real life. Staff are more likely to use SOPs if they match day-to-day operations.</p><p><strong>7. Review and Update Regularly</strong></p><p>Hospitality trends, technology, and guest expectations change. Review SOPs every few months to ensure they are up-to-date.</p><p><strong>Best Practices for Writing SOPs in Hospitality</strong></p><ul><li>Use a Standard Format — Consistency across SOPs makes them easier to read.</li><li>Keep Language Simple — Write for quick understanding, not long explanations.</li><li>Involve Your Team — Ask frontline employees for input; they know the practical challenges.</li><li>Focus on Guest Experience — Always link back to how the SOP improves service.</li><li>Make SOPs Accessible — Keep them in a digital manual, staff portal, or printed handbook.</li></ul><p><strong>Example of a Hospitality SOP Template</strong></p><p>Here’s a simple template you can adapt:</p><p>Title: Guest Check-in SOP</p><p>Department: Front Office</p><p>Objective: To ensure guests are checked in within 5 minutes while maintaining a professional and welcoming experience.</p><p>Responsible Person(s): Front Desk Agent</p><p>Procedure:</p><ol><li>Greet guest warmly.</li><li>Confirm reservation details.</li><li>Verify ID and process payment.</li><li>Provide room key and explain hotel amenities.</li><li>Offer assistance with luggage if needed.</li><li>Conclude with a friendly farewell.</li></ol><p>Review Date: [Insert Date]</p><p>Approved By: [Insert Manager’s Name]</p><p><strong>Final Thoughts</strong></p><p>In hospitality, the guest experience is everything — and SOPs are the hidden framework that makes great service possible. A well-written SOP is not just a document; it’s a tool that empowers your team, streamlines operations, and guarantees that every guest feels valued and cared for.</p><p>By following clear steps and focusing on practicality, you can create SOPs that not only guide your staff but also set your hospitality business apart from the competition.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d425938ab4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding HACCP: A Complete Guide for Food Safety]]></title>
            <link>https://diyorbekmamadaliev.medium.com/understanding-haccp-a-complete-guide-for-food-safety-8d225fdb48ec?source=rss-d3b6f7959c1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d225fdb48ec</guid>
            <category><![CDATA[food]]></category>
            <category><![CDATA[food-and-beverage]]></category>
            <category><![CDATA[safety]]></category>
            <category><![CDATA[restaurant]]></category>
            <category><![CDATA[hospitality]]></category>
            <dc:creator><![CDATA[Diyorbek Mamadaliev]]></dc:creator>
            <pubDate>Mon, 11 Aug 2025 14:00:05 GMT</pubDate>
            <atom:updated>2025-08-11T14:00:05.454Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Understanding HACCP: A Complete Guide for Food Safety</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IDhXbJ4WOwdOIvxVgGVWPA.png" /></figure><p><strong>Introduction</strong></p><p>In today’s global food industry, ensuring the safety and quality of products is not only a legal requirement but also a cornerstone of customer trust. One of the most widely recognized systems for managing food safety is HACCP — short for Hazard Analysis and Critical Control Points. Originally developed in the 1960s for NASA’s space program, HACCP has evolved into an international standard used by food manufacturers, restaurants, and distributors worldwide.</p><p>This article provides a detailed overview of HACCP, its principles, its importance in the food industry, and how it is implemented in real-world operations.</p><p><strong>What is HACCP?</strong></p><p>HACCP is a systematic, preventive approach to food safety that identifies, evaluates, and controls hazards that could compromise the safety of food products. Unlike traditional inspection methods that focus on end-product testing, HACCP emphasizes prevention during the production process.</p><p>The system covers three main types of hazards:</p><ol><li>Biological hazards — bacteria, viruses, parasites, mold.</li><li>Chemical hazards — cleaning agents, pesticides, allergens, food additives in unsafe amounts.</li><li>Physical hazards — glass, metal fragments, plastic, stones.</li></ol><p>By controlling these hazards at specific points in production, HACCP minimizes the risk of foodborne illnesses and ensures compliance with regulations.</p><p><strong>Why is HACCP Important?</strong></p><p>The importance of HACCP can be summed up in three key points:</p><ol><li>Protecting Public Health<br> Preventing contamination reduces the incidence of foodborne illnesses, protecting consumers from potentially severe health risks.</li><li>Legal and Regulatory Compliance<br> Many countries require HACCP-based systems for certain sectors of the food industry, making it a necessary part of operations to avoid fines or closure.</li><li>Business Reputation and Consumer Confidence<br> A visible commitment to food safety builds trust with customers, partners, and regulators, strengthening a brand’s image.</li></ol><p><strong>The Seven Principles of HACCP</strong></p><p>The HACCP system is built on seven core principles, which guide organizations through the process of hazard control.</p><ol><li>Conduct a Hazard Analysis<br> Identify potential hazards at each stage of production — from raw material sourcing to final distribution.</li><li>Determine Critical Control Points (CCPs)<br> Pinpoint stages where controls can be applied to prevent, eliminate, or reduce hazards to safe levels.</li><li>Establish Critical Limits<br> Define measurable limits for each CCP, such as temperature ranges, pH levels, or cooking times, that must be met to ensure safety.</li><li>Establish Monitoring Procedures<br> Set up procedures to regularly check that CCPs remain within critical limits, ensuring hazards are under control.</li><li>Establish Corrective Actions<br> Outline actions to take when monitoring shows that a CCP is not within the defined critical limits.</li><li>Establish Verification Procedures<br> Regularly verify that the HACCP system is working effectively through audits, inspections, and testing.</li><li>Establish Documentation and Record Keeping<br> Keep detailed records of all HACCP activities, including hazard analyses, CCP monitoring, and corrective actions, to provide evidence of compliance.</li></ol><p><strong>Implementing HACCP in the Workplace</strong></p><p>Implementing HACCP involves a structured, step-by-step approach:</p><ol><li>Assemble the HACCP Team — Gather a multidisciplinary group with expertise in production, quality control, and food safety.</li><li>Describe the Product and its Intended Use — Define product specifications and identify the target consumer.</li><li>Construct a Process Flow Diagram — Map out each stage of production to identify where hazards may occur.</li><li>On-Site Verification of the Flow Diagram — Ensure the diagram matches actual operations.</li><li>Apply the Seven HACCP Principles — Follow each principle systematically, tailoring them to the specific production process.</li></ol><p><strong>Challenges in HACCP Implementation</strong></p><p>While HACCP is highly effective, businesses may face challenges such as:</p><ul><li>Lack of trained staff or HACCP expertise.</li><li>Resistance to change in established workflows.</li><li>Costs associated with training, monitoring, and verification.</li><li>Maintaining accurate documentation over time.</li></ul><p>Addressing these issues requires strong management commitment, ongoing training, and a culture of continuous improvement.</p><p><strong>HACCP and International Standards</strong></p><p>HACCP is often integrated with other food safety and quality management systems, such as:</p><ul><li>ISO 22000 — A global food safety management standard incorporating HACCP principles.</li><li>Codex Alimentarius — International food standards developed by the FAO and WHO.</li><li>GFSI-recognized schemes — Including BRCGS, SQF, and FSSC 22000.</li></ul><p><strong>Conclusion</strong></p><p>HACCP is more than just a regulatory requirement — it is a proactive, science-based approach to safeguarding food from hazards. By following its principles, food businesses can protect consumers, ensure compliance, and maintain trust in an increasingly competitive market. Successful implementation requires commitment, training, and continuous improvement, but the benefits for public health and business success make HACCP an essential part of modern food safety management.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d225fdb48ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recipe Costing to Optimize Profitability: A Practical Guide for Restaurateurs and Chefs]]></title>
            <link>https://diyorbekmamadaliev.medium.com/recipe-costing-to-optimize-profitability-a-practical-guide-for-restaurateurs-and-chefs-2ff115665594?source=rss-d3b6f7959c1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ff115665594</guid>
            <category><![CDATA[hospitality]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[restaurant]]></category>
            <category><![CDATA[food]]></category>
            <dc:creator><![CDATA[Diyorbek Mamadaliev]]></dc:creator>
            <pubDate>Wed, 06 Aug 2025 15:24:09 GMT</pubDate>
            <atom:updated>2025-08-06T17:31:03.494Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*2kkSuNYKM24ShyjwE4cijA.png" /></figure><p>In today’s competitive food and beverage (F&amp;B) industry, profitability isn’t just about how delicious your dish tastes — it’s about how well you <strong>control your costs and pricing strategies</strong>. Whether you run a fine-dining restaurant, a street food stall, or a cloud kitchen, <strong>recipe costing</strong> is your financial compass. It helps you price dishes wisely, maintain healthy profit margins, and sustain long-term success.</p><p>In this article, I’ll break down a simple but powerful framework for <strong>recipe costing to optimize profitability</strong>, step-by-step.</p><h3>1. Ingredient Costing: The Core of Recipe Pricing</h3><p>This is where everything starts. Ingredient costing is the process of calculating the <strong>cost of each ingredient</strong> used in your recipe — not by pack or by kilo, but by the <strong>exact amount you use</strong> in a single dish.</p><h3>🔍 Example:</h3><ul><li>You buy 1 kg of flour for $2.</li><li>Your recipe uses 250g of flour.</li><li>So, flour cost per portion = $2 × 0.25 = <strong>$0.50</strong></li></ul><p>Do this for every ingredient: salt, butter, cream, herbs, oil — everything. This ensures you <strong>know exactly what you’re spending</strong> on each dish.</p><h3>✅ Pro Tip:</h3><p>Use an Excel sheet or recipe costing software to automate these calculations. Update prices regularly, as ingredient costs can fluctuate.</p><h3>2. Recipe Yield: How Many Portions Does It Make?</h3><p>Knowing how much a recipe produces is essential for <strong>calculating the cost per portion</strong>.</p><h3>🔍 Example:</h3><ul><li>Your soup recipe makes 4,000 grams of soup.</li><li>You serve 500g per bowl.</li><li>Yield = 4,000g ÷ 500g = <strong>8 servings</strong></li></ul><p>If your total ingredient cost is $12, your cost per portion is:<br>$12 ÷ 8 = <strong>$1.50 per serving</strong></p><h3>✅ Pro Tip:</h3><p>Always measure your final yield — guesswork leads to undercharging or overproduction, both of which hurt profits.</p><h3>3. Overhead Costs: The Hidden Expenses Behind the Dish</h3><p>Overhead costs are <strong>indirect expenses</strong> that don’t appear on your plate but are essential to production.</p><p>These include:</p><ul><li><strong>Labor costs</strong> (chef salaries, prep time)</li><li><strong>Utilities</strong> (gas, electricity, water)</li><li><strong>Rent or facility maintenance</strong></li><li><strong>Packaging and delivery</strong></li><li><strong>Equipment depreciation</strong></li></ul><p>Overheads are often estimated <strong>as a percentage</strong> of the recipe cost or assigned as a <strong>flat rate per dish</strong>.</p><h3>🔍 Example:</h3><p>If overheads are estimated at 25% of your ingredient cost:</p><ul><li>Ingredient cost = $1.50</li><li>Overhead = $1.50 × 0.25 = <strong>$0.375</strong></li><li>Total cost = $1.50 + $0.375 = <strong>$1.875</strong></li></ul><h3>4. Recipe Cost Calculation: The Real Cost Per Plate</h3><p>Once you’ve calculated ingredient cost and added overhead, you get your <strong>true cost per dish</strong>.</p><h3>🔍 Example:</h3><ul><li>Ingredient cost = $1.50</li><li>Overhead = $0.375</li><li>Final cost per portion = <strong>$1.875</strong></li></ul><p>This is <strong>not your selling price</strong>. This is your baseline cost. Selling the dish below this number means you’re <strong>losing money</strong>.</p><h3>5. Profit Margin Calculation: What Should You Charge?</h3><p>Here’s where profitability comes into play. To stay afloat — and thrive — your selling price must <strong>include a profit margin</strong>.</p><p>You can calculate this in two ways:</p><h3>✅ Method 1: Desired Profit Formula</h3><p>If you want a 50% profit margin:</p><ul><li>Final cost = $1.875</li><li>Selling price = $1.875 × 1.5 = <strong>$2.81</strong></li></ul><h3>✅ Method 2: Fixed Price Strategy</h3><p>You want to charge $3.00.</p><ul><li>Cost = $1.875</li><li>Profit = $3.00 — $1.875 = <strong>$1.125</strong></li><li>Profit margin = $1.125 ÷ $3.00 ≈ <strong>37.5%</strong></li></ul><p>Whichever method you use, the key is to <strong>ensure your margins are healthy</strong> and cover both fixed and variable expenses.</p><h3>Bonus: Regular Review is Essential 📈</h3><blockquote>“Finally, implement a regular review and update menu prices based on changes.”</blockquote><p>Prices of ingredients change. Utility bills go up. Salaries rise. If your menu prices remain fixed for too long, your profitability silently disappears.</p><p>Make it a habit to <strong>review and update your recipe costing every 3 to 6 months</strong>, especially for top-selling or high-cost dishes.</p><h3>Final Thoughts</h3><p>Recipe costing isn’t just a numbers game — it’s the <strong>backbone of a successful food business</strong>. By mastering it, you ensure that every dish contributes to your bottom line, not eats away at it.</p><p>Here’s a quick recap checklist:</p><p>✅ Calculate ingredient costs accurately<br>✅ Determine recipe yield per batch<br>✅ Include realistic overheads<br>✅ Know your true recipe cost<br>✅ Set prices with a clear profit margin<br>✅ Regularly review and adjust</p><p>If you’re serious about growth, put as much effort into <strong>costing and pricing</strong> as you do into cooking. Because in hospitality, <strong>profitability is just as important as hospitality.</strong></p><p>✍️ <em>Written by Diyorbek Mamadaliev Jr.</em><br><em>Hospitality Professional</em></p><p>Would you like a <strong>free Google Sheets template</strong> for recipe costing? <a href="https://docs.google.com/spreadsheets/d/11QZb-denTGHlXrQwonnk5qRXVxx0_dtMQh2hPsBuneI/edit?usp=sharing">Download Here.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ff115665594" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ten Principles of Economics: A Simple Guide to How the Economy Works]]></title>
            <link>https://diyorbekmamadaliev.medium.com/the-ten-principles-of-economics-a-simple-guide-to-how-the-economy-works-ca5c9db8e17b?source=rss-d3b6f7959c1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca5c9db8e17b</guid>
            <category><![CDATA[science]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[economics]]></category>
            <dc:creator><![CDATA[Diyorbek Mamadaliev]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 02:42:09 GMT</pubDate>
            <atom:updated>2025-08-05T02:42:09.365Z</atom:updated>
            <content:encoded><![CDATA[<p>Economics is not just about graphs, inflation rates, or GDP statistics. At its core, it’s the study of how people make decisions and how those decisions interact to shape our world. Whether you’re managing a household budget, starting a business, or voting in an election, you’re participating in the economy.</p><p>To help us make sense of this vast and complex subject, Harvard economist Gregory Mankiw introduced <strong>Ten Principles of Economics</strong> in his widely-used textbook. These principles provide a solid foundation for understanding how individuals, markets, and governments interact. They are divided into three broad categories:</p><h3>How People Make Decisions</h3><h3>1. People Face Trade-offs</h3><p>The first principle of economics reminds us of a basic truth: <strong>nothing is free</strong>. Making one decision often means giving up another. For example, a student who chooses to spend an evening studying sacrifices time that could have been used for leisure or work. A government deciding to invest more in defense may need to reduce spending on healthcare or education.</p><p><strong>Trade-offs</strong> are everywhere — between time and money, efficiency and equality, or security and freedom. Recognizing these trade-offs helps individuals and societies make informed decisions.</p><h3>2. The Cost of Something Is What You Give Up to Get It</h3><p>This is the idea of <strong>opportunity cost</strong>. When we make choices, we give up the next best alternative. It’s not just about monetary cost, but everything we forgo to make that choice.</p><p>For instance, if you decide to attend college, the cost isn’t just tuition. It includes the <strong>income you give up</strong> by not working full-time. Understanding opportunity costs leads to better decision-making because it highlights the true impact of our choices.</p><h3>3. Rational People Think at the Margin</h3><p>Economists assume that people are <strong>rational</strong>, meaning they systematically and purposefully do the best they can to achieve their objectives. Rational decision-makers compare <strong>marginal benefits</strong> (the additional benefit of an action) with <strong>marginal costs</strong> (the additional cost).</p><p>For example, a coffee shop deciding whether to stay open for an extra hour considers whether the revenue from late customers exceeds the cost of staff wages and utilities during that hour. Thinking at the margin allows businesses and individuals to fine-tune their actions for the best outcomes.</p><h3>4. People Respond to Incentives</h3><p>Incentives matter — they shape our choices and behavior. A higher price on cigarettes, for example, may discourage smoking. A tax break on solar panels may encourage more people to install them.</p><p><strong>When incentives change, behavior often changes</strong> in predictable ways. This principle explains everything from why students study harder for exams (grades are an incentive) to why companies innovate (profits are an incentive).</p><h3>How People Interact</h3><h3>5. Trade Can Make Everyone Better Off</h3><p>Contrary to the belief that trade is a zero-sum game, economics teaches us that <strong>voluntary trade benefits both sides</strong>. It allows people to specialize in what they do best and enjoy a greater variety of goods and services.</p><p>A farmer trading wheat for a tailor’s clothing, or countries exchanging oil for electronics, are both examples of mutually beneficial trade. Through trade, individuals and nations can consume more than they could produce on their own.</p><h3>6. Markets Are Usually a Good Way to Organize Economic Activity</h3><p>In a <strong>market economy</strong>, decisions about production and consumption are made by millions of individuals interacting in the marketplace. Prices guide these decisions, balancing supply and demand.</p><p>Rather than central planning, <strong>the invisible hand of the market</strong> — as Adam Smith described it — coordinates economic activity efficiently. Buyers and sellers, pursuing their own interests, end up benefiting society as a whole.</p><h3>7. Governments Can Sometimes Improve Market Outcomes</h3><p>While markets are powerful, they are not perfect. Sometimes <strong>market failures</strong> occur — like externalities (pollution), monopolies, or the under-provision of public goods (like streetlights or national defense).</p><p>Governments can play a vital role in correcting these failures, <strong>enforcing property rights</strong>, and ensuring a level playing field. For example, laws against fraud protect consumers, while subsidies for education promote positive externalities for society.</p><h3>How the Economy as a Whole Works</h3><h3>8. A Country’s Standard of Living Depends on Its Ability to Produce Goods and Services</h3><p>The <strong>productivity</strong> of a nation’s workers — how much goods and services they produce per hour — largely determines the standard of living. Countries with highly educated workers, efficient technologies, and good infrastructure tend to have <strong>higher GDP per capita</strong>, translating to better living conditions.</p><p>Economic policies that enhance productivity — such as investments in education, innovation, and infrastructure — are key to long-term prosperity.</p><h3>9. Prices Rise When the Government Prints Too Much Money</h3><p><strong>Inflation</strong>, or the general rise in prices, is typically caused by an increase in the money supply. When too much money chases too few goods, prices increase. This principle links <strong>monetary policy</strong> to price stability.</p><p>A government that <strong>prints excessive money</strong> to pay its bills (as seen in some historical hyperinflations) undermines the value of its currency and erodes public trust in the economy.</p><h3>10. Society Faces a Short-Run Trade-off Between Inflation and Unemployment</h3><p>In the <strong>short run</strong>, policies that reduce unemployment (such as increasing government spending or lowering interest rates) can lead to higher inflation, and vice versa. This trade-off is depicted in the <strong>Phillips Curve</strong>.</p><p>While this relationship may not hold in the long term, it plays a crucial role in shaping short-run economic policy. Policymakers must navigate this delicate balance carefully — stimulating the economy without letting inflation spiral.</p><h3>Conclusion</h3><p>The Ten Principles of Economics are more than textbook jargon — they are a lens through which we can better understand the world. From the choices we make as individuals to the policies governments adopt, economics is always at play.</p><p>Whether you’re a student, entrepreneur, policymaker, or just a curious mind, keeping these principles in your toolkit can help you <strong>make smarter decisions</strong>, <strong>interpret global events</strong>, and <strong>navigate the complex web of economic life</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca5c9db8e17b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering the Menu Engineering Matrix: Stars, Puzzles, Plowhorses & Dogs]]></title>
            <link>https://diyorbekmamadaliev.medium.com/mastering-the-menu-engineering-matrix-stars-puzzles-plowhorses-dogs-04bd02940d1e?source=rss-d3b6f7959c1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/04bd02940d1e</guid>
            <category><![CDATA[food-and-drink]]></category>
            <category><![CDATA[restaurant-business]]></category>
            <category><![CDATA[food-and-beverage]]></category>
            <category><![CDATA[hospitality]]></category>
            <category><![CDATA[food]]></category>
            <dc:creator><![CDATA[Diyorbek Mamadaliev]]></dc:creator>
            <pubDate>Sun, 13 Jul 2025 20:56:36 GMT</pubDate>
            <atom:updated>2025-07-13T21:08:26.278Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*APNg4CEnhWy2_Rn-SETTdQ.png" /></figure><p>Your restaurant menu isn’t just a catalog of meals — it’s a strategic revenue-driving tool. With rising ingredient costs and tighter margins, optimizing what you offer is crucial. Enter the <strong>Menu Engineering Matrix</strong>, a four-quadrant framework that evaluates dishes based on <strong>popularity</strong> (sales volume) and <strong>profitability</strong> (margin per item). Here’s how to use it to your advantage.</p><h3>What Is the Menu Engineering Matrix?</h3><p>A two-axis chart with:</p><ul><li><strong>X-axis</strong>: Popularity (low ←→ high)</li><li><strong>Y-axis</strong>: Profitability (low ←→ high)</li></ul><p>This creates four quadrants:</p><ol><li><strong>Stars</strong> = High Profit, High Popularity</li><li><strong>Puzzles</strong> = High Profit, Low Popularity</li><li><strong>Plowhorses</strong> = Low Profit, High Popularity</li><li><strong>Dogs</strong> = Low Profit, Low Popularity</li></ol><p>This simple plot helps strategize which items to <strong>promote</strong>, <strong>tweak</strong>, or <strong>remove.</strong></p><h3>Your Menu, Categorized</h3><h4>⭐ Stars (High Profit + High Sales)</h4><ul><li>These are your signature winners — think Big Mac in the fast-food world.</li><li><strong>Action</strong>: Promote front-and-center; use premium descriptions; feature in specials and combo deals.</li></ul><h4>🧩 Puzzles (High Profit + Low Sales)</h4><ul><li>Hidden goldmines that aren’t catching customers’ attention.</li><li><strong>Action</strong>: Revamp descriptions, reposition on the menu, run promotions — or test slight price drops.</li></ul><h4>🐴 Plowhorses (Low Profit + High Sales)</h4><ul><li>Popular staples suffering from margin erosion.</li><li><strong>Action</strong>: Re-engineer recipes, slightly adjust pricing, reduce portion sizes, or pair with a high-margin side/drink.</li></ul><h4>🐶 Dogs (Low Profit + Low Sales)</h4><ul><li>Time to declutter — these dishes are dragging down performance.</li><li><strong>Action</strong>: Retire or rebrand/remove emphasis; if retained, tuck them in less prominent spots</li></ul><h3>How to Build Your Matrix</h3><ol><li><strong>Choose your review period</strong>: quarterly is ideal, but even biannual or seasonal checks work .</li><li><strong>Pull data</strong>: gather food cost, price charged, and units sold — typically available through POS systems or spreadsheets.</li><li><strong>Calculate</strong>:</li></ol><ul><li><strong>Food Cost %</strong> = Cost ÷ Price</li><li><strong>Contribution Margin</strong> = (Price — Cost) × Volume.</li></ul><ol><li><strong>Plot items</strong> on your matrix and group them.</li><li><strong>Plan action</strong>, implement changes, then <strong>monitor results</strong> via your POS system.</li><li><strong>Repeat regularly</strong> — ideally quarterly or seasonally to stay agile.</li></ol><h3>Menu Psychology Tips to Boost Results</h3><p>Use subtle design tricks to steer reader behavior:</p><ul><li><strong>Golden triangle placement</strong>: customers’ eyes are drawn to the center and top‑right of menus.</li><li><strong>Sensory descriptions</strong>: phrases like “crispy,” “velvety,” or “grass‑fed” elevate perceived value.</li><li><strong>Decoy pricing/anchoring</strong>: introduce a premium option to make your target dish look like a bargain.</li><li><strong>Omit currency signs</strong>: reduces price anchoring, encouraging higher spend.</li></ul><h3>Beyond the Matrix: Minimize Waste, Maximize Impact</h3><ul><li><strong>Minimum Viable Menu (MVM)</strong>: pare down to the most profitable items — less inventory, less waste, more focus.</li><li><strong>Digital &amp; delivery menus</strong>: higher overhead means adjusting prices or offerings for takeout/delivery.</li><li><strong>Data visualization</strong>: dashboards, heatmaps, and plotting help reveal insights faster.</li></ul><h3>Real-World Example: McDonald’s Big Mac</h3><ul><li><strong>Star</strong>: iconic, low-cost, high sales — positioned in combos/global marketing campaigns.</li></ul><p>A well‑engineered menu is a powerful ally — not just visually appealing, but data-driven and profitable. By leveraging the matrix, your menu can do the heavy lifting: steering diners toward dishes that delight them and drive your bottom line.</p><p>More information: <a href="https://pos.toasttab.com/blog/on-the-line/menu-engineering-matrix?srsltid=AfmBOoqe-M4CWYV9i_WTnGiYYDMAvSuumEe8_Zu2ySUYxNLTeVlT-yob">Menu Engineering Matrix: Your Guide to Stars, Puzzles, &amp; More</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04bd02940d1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Direct vs. Indirect Cash Flow Methods]]></title>
            <link>https://diyorbekmamadaliev.medium.com/selenium-webdriver-cachelookup-in-test-automation-why-and-when-to-use-cachelookup-annotation-in-ba0bf241eb06?source=rss-d3b6f7959c1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba0bf241eb06</guid>
            <category><![CDATA[economics]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[accounting]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[Diyorbek Mamadaliev]]></dc:creator>
            <pubDate>Sun, 26 Nov 2023 10:44:37 GMT</pubDate>
            <atom:updated>2025-12-17T13:13:25.669Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sfnLMoH4IZ7ZdQ89ur5gyA.png" /></figure><h3>Introduction</h3><p>Cash flow is the lifeblood of any business. While profits may look promising on paper, it’s the actual movement of cash that determines whether a company can pay its bills, invest in growth, or survive tough times. In this article, we’ll break down the two main methods of reporting cash flow direct and indirect showing how they relate to the income statement, using a clear example.</p><h3>What is Cash Flow?</h3><p>Cash flow refers to the net amount of cash being transferred into and out of a business. It’s a key indicator of financial health, showing whether a company is generating enough cash to sustain operations, pay debts, and invest in future growth.</p><h3>Direct Cash Flow Method</h3><p>The direct method reports actual cash transactions:</p><ul><li><strong>Cash from customers</strong></li><li><strong>Cash paid to suppliers</strong></li><li><strong>Cash paid for operating expenses</strong></li></ul><p>This method gives a transparent view of cash inflows and outflows, making it easier to understand how money moves through the business. However, it requires detailed tracking and is less commonly used in external reporting.</p><h3>Indirect Cash Flow Method</h3><p>The indirect method starts with net income from the income statement and adjusts for:</p><ul><li><strong>Non-cash expenses</strong> (like depreciation)</li><li><strong>Changes in working capital</strong> (such as accounts receivable and payable)</li></ul><p>This method is easier to prepare and aligns with accrual accounting, making it the preferred choice for most companies.</p><h3>Direct vs. Indirect: Key Differences</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y-yWjVySLmtoP4_XcDr7Kg.png" /></figure><h3>Example with Income Statement</h3><p>Let’s consider a simplified example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAmRqCWU2LSYncmmb2TQHA.jpeg" /></figure><h3>Income Statement</h3><ul><li>Revenue: 630</li><li>Purchases: (330)</li><li>Expenses: (70)</li><li>Depreciation: (55)</li><li><strong>Net Income: 175</strong></li></ul><h3>Cash Flow Direct Method</h3><ul><li>Cash from Sales: 580</li><li>Cash on Purchases: (290)</li><li>Cash Expenses: (70)</li><li><strong>Change in Cash: 220</strong></li></ul><h3>Cash Flow Indirect Method</h3><ul><li>Net Income: 175</li><li>Increase in Accounts Receivable: (50)</li><li>Increase in Accounts Payable: 40</li><li>Depreciation: 5</li><li><strong>Change in Cash: 220</strong></li></ul><p>Despite different approaches, both methods reconcile to the same change in cash. The direct method shows actual cash movements, while the indirect method explains how net income translates into cash.</p><h3>When to Use Each Method</h3><ul><li><strong>Direct Method</strong>: Ideal for internal analysis and cash management.</li><li><strong>Indirect Method</strong>: Preferred for external reporting and compliance.</li></ul><h3>Conclusion</h3><p>Understanding both cash flow methods helps you interpret financial statements more effectively. Whether you’re managing a startup or analyzing a public company, knowing how cash moves — and how it’s reported — can give you a clearer picture of financial reality.</p><p>Want to dive deeper into how cash flow affects business decisions or explore more examples? Let’s keep the conversation going.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba0bf241eb06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Selenium WebDriver PageFactory: Simplifying Test Automation (Lazy Proxying and Annotations)]]></title>
            <link>https://diyorbekmamadaliev.medium.com/selenium-pagefactory-simplifying-test-automation-lazy-proxying-and-annotations-410880985643?source=rss-d3b6f7959c1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/410880985643</guid>
            <category><![CDATA[selenium-webdriver]]></category>
            <category><![CDATA[qa-automation]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Diyorbek Mamadaliev]]></dc:creator>
            <pubDate>Sun, 19 Nov 2023 10:55:50 GMT</pubDate>
            <atom:updated>2023-11-30T04:56:46.445Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*vm-Od6VMnO27mNEyM7Mscg.png" /></figure><p>Selenium WebDriver stands as a cornerstone in the world of automated testing, empowering developers and QA engineers to validate web applications efficiently. Yet, managing test code can become unwieldy as projects grow in complexity. Enter the Page Object Model (POM), a design pattern that revolutionizes test maintenance by encapsulating web page elements within dedicated classes. However, the magic truly unfolds when combined with Selenium’s PageFactory.</p><h3>What is PageFactory?</h3><p>PageFactory in Selenium WebDriver acts as the catalyst in POM’s success story. It’s the engine that fuels the simplified initialization of web elements within page objects. Think of it as the glue that effortlessly binds elements on a web page to corresponding variables in your test code using annotations like @FindBy, @FindBys, and @FindAll.</p><h3>Benefits of Using PageFactory</h3><h4>1. Improved Code Readability and Maintainability</h4><p>By encapsulating web elements within PageFactory-initialized classes, code becomes more organized, readable, and easier to maintain.</p><h4>2. Reduced Code Duplication and Enhanced Reusability</h4><p>PageFactory promotes reusability by allowing easy access to web elements across multiple tests without redundant code.</p><h4>3. Simplified Initialization of Web Elements</h4><p>Annotations like @FindBy reduce the hassle of locating and initializing web elements manually, streamlining the testing process.</p><h4>4. Enhanced Scalability and Easier Test Maintenance</h4><p>As projects expand, maintaining and scaling tests becomes less daunting with PageFactory, enabling swift adjustments and additions.</p><h3>Working with PageFactory</h3><p>Implementing PageFactory involves a straightforward process:</p><p><strong><em>Import Necessary Packages:</em></strong></p><p>Import org.openqa.selenium.support.FindBy and org.openqa.selenium.support.PageFactory for usage.</p><p><strong><em>Create a Page Class:</em></strong></p><ul><li>Define web elements within the page class using @FindBy annotations.</li></ul><p><strong><em>Initialize Elements:</em></strong></p><ul><li>Utilize PageFactory.initElements(driver, this) to initialize the web elements.</li></ul><p>Let’s delve into an example to better grasp the implementation:</p><pre>import org.openqa.selenium.WebDriver;<br>import org.openqa.selenium.WebElement;<br>import org.openqa.selenium.support.FindBy;<br>import org.openqa.selenium.support.PageFactory;<br><br>public class LoginPage {<br>    private WebDriver driver;<br><br>    @FindBy(id = &quot;username&quot;)<br>    private WebElement usernameInput;<br><br>    @FindBy(id = &quot;password&quot;)<br>    private WebElement passwordInput;<br><br>    @FindBy(id = &quot;loginButton&quot;)<br>    private WebElement loginButton;<br><br>    public LoginPage(WebDriver driver) {<br>        this.driver = driver;<br>        PageFactory.initElements(driver, this);<br>    }<br><br>    // Other Methods to interact with elements...<br>}</pre><h3>Built-in Lazy Proxying Invoked via PageFactory.initElements Method</h3><p>When you invoke PageFactory.initElements(driver, this) in a page class constructor, it initializes the WebElements declared using @FindBy annotations. One crucial aspect of this initialization is &quot;lazy loading&quot; or &quot;lazy initialization.&quot; In the context of PageFactory, lazy initialization means that the elements are not immediately found and stored when the page class is instantiated.</p><p>Instead, these elements are initialized as “proxies” or placeholders. The actual finding of these elements from the web page happens only when an action or method is called upon those elements. The proxy element holds the information about how to locate the real element when the action is triggered. This lazy loading mechanism reduces the overhead of searching for elements when the page class is instantiated, enhancing efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*puaFAJsPe_qeslEII6oWHg.png" /></figure><h3>@FindBy Annotations for WebElement Fields with ‘static final’ Locators</h3><p>The @FindBy annotation in Selenium allows you to declare and initialize web elements in a page class. You can specify different locators (such as ID, XPath, CSS, etc.) to uniquely identify these elements on a web page.</p><p>In the example provided:</p><pre>@FindBy(xpath=&quot;//*[value=&#39;Go&#39;]&quot;)<br>private WebElement searchButton;</pre><ul><li>@FindBy(xpath=&quot;//*[value=&#39;Go&#39;]&quot;) indicates that the searchButton WebElement is located by an XPath expression that finds an element with the attribute value set to &#39;Go&#39;.</li><li>private WebElement searchButton; declares a private WebElement variable named searchButton.</li></ul><p>Adding static final to the WebElement field is not necessary or common when using @FindBy annotations. The static final keywords would imply that the WebElement is a constant and initialized once. However, web elements initialized via @FindBy are typically not constants and are initialized lazily (i.e., when the corresponding method or action is called), hence they are not usually declared as static final.</p><h3>Compact Syntax</h3><p>The compact syntax refers to concise and straightforward code expressions used to interact with web elements initialized through PageFactory and @FindBy annotations.</p><pre>searchButton.click();</pre><p>This line of code demonstrates the simplicity achieved by using PageFactory and @FindBy annotations. Here, searchButton is the WebElement initialized using @FindBy, and the .click() method is invoked on this element. It succinctly represents the action of clicking the &#39;Go&#39; button without the need for complex or verbose code to find and interact with the element.</p><p>By utilizing the compact syntax, code readability improves, making it easier to understand and maintain the test automation scripts.</p><p>These aspects collectively contribute to making PageFactory in Selenium a powerful and efficient way to organize, initialize, and interact with web elements in automated tests, streamlining the process and enhancing maintainability.</p><h3>Best Practices and Tips</h3><p>To harness PageFactory’s potential effectively:</p><ul><li>Follow consistent naming conventions for page classes and web elements.</li><li>Handle complex page structures and dynamic elements with clear strategies.</li><li>Leverage PageFactory in harmony with other Selenium features like WebDriverWait and the PageObject pattern.</li></ul><h3>Potential Challenges and Solutions</h3><p>Despite its advantages, challenges may arise:</p><ul><li>Addressing dynamic elements, AJAX calls, or slow-loading elements requires strategic handling.</li><li>Solutions often involve implementing explicit waits or utilizing alternative locating strategies.</li></ul><h3>Real-world Examples and Use Cases</h3><p>Let’s witness PageFactory in action:</p><h4>Scenario:</h4><p>Imagine a scenario where a test suite needs to navigate through various pages and interact with elements like input fields, buttons, and dropdowns.</p><h4>Implementation:</h4><p>Showcase how PageFactory simplifies this process, enhances script readability, and aids in maintaining a cohesive test suite.</p><h3>Conclusion</h3><p>In summary, Selenium’s PageFactory serves as a linchpin in the Page Object Model, empowering test automation by promoting efficiency, maintainability, and scalability. Embrace PageFactory to optimize your test scripts and fortify the foundation of your automation framework.</p><h3>Additional Resources and References</h3><ul><li><a href="https://www.selenium.dev/documentation/en/support_packages/page_factory/">Selenium PageFactory Documentation</a></li><li><a href="https://www.javadoc.io/doc/org.seleniumhq.selenium/selenium-support/4.1.0/org/openqa/selenium/support/PageFactory.html">Official WebDriver PageFactory JavaDoc</a></li></ul><h3>Final Thoughts</h3><p>Leveraging PageFactory has been a game-changer in my experience, drastically enhancing test suite management and efficiency. I invite you to share your thoughts, experiences, or questions on how PageFactory has influenced your test automation journey.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=410880985643" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Selenium WebDriver: Waits for Test Automation (Timeouts, Threads.sleep,]]></title>
            <link>https://diyorbekmamadaliev.medium.com/mastering-selenium-waits-for-test-automation-timeouts-threads-sleep-4d471b7dbeca?source=rss-d3b6f7959c1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d471b7dbeca</guid>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[selenium-waits]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[selenium-webdriver]]></category>
            <category><![CDATA[selenium-test-automation]]></category>
            <dc:creator><![CDATA[Diyorbek Mamadaliev]]></dc:creator>
            <pubDate>Sun, 12 Nov 2023 21:08:53 GMT</pubDate>
            <atom:updated>2023-11-30T04:55:50.255Z</atom:updated>
            <content:encoded><![CDATA[<h3>Selenium WebDriver: Waits for Test Automation (Timeouts, Threads.sleep, Explicit Wait, Implicit Wait &amp; Fluent Wait)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*CI9HSTwhWBjcIyItfE7jJg.png" /></figure><h3>Content</h3><ul><li><strong>Selenium Timeouts</strong></li><li><strong>Threads.sleep()</strong></li><li><strong>Explicit Wait</strong></li><li><strong>Implicit Wait</strong></li><li><strong>Fluent Wait</strong></li></ul><p>Selenium waits for page load play an important part in your Selenium scripts. They help to make them less flaky and more reliable. Selenium provides multiple waits to provide adequate wait or pause in your script execution based on certain conditions. Thereby ensuring you don’t end up getting failed scripts as you perform automation testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OEKXkqSWVsyu33VkYdOENg.jpeg" /></figure><blockquote>Proper “wait” methods are always implemented in WebdriverWait or ExpectedConditions</blockquote><h3>Selenium Timeouts (Sync issues solution)</h3><p>In Selenium, a TimeoutException is an exception raised when an operation runs out after a specified period. For example, when using the WebDriver.get method to load a page, the default timeout is set to 30 seconds. If the page takes longer than 30 seconds to load, a TimeoutException will be raised.</p><p>Default Selenium Timeouts:</p><p><strong>Implicit Wait</strong></p><ul><li>0 seconds for implicit waits. Here the Selenium Command reports immediately if it cannot find an element.</li></ul><p><strong>Page Load</strong></p><ul><li>300 seconds<strong> </strong>for page loads</li></ul><p><strong>Script Load</strong></p><ul><li>30 seconds<strong> </strong>for script timeouts</li></ul><p><strong>How does Selenium handle connection timeout?</strong></p><p>In Selenium, you can handle a connection timeout by setting a timeout value for the WebDriver using the set_page_load_timeout() method. This method sets the maximum time (in seconds) that the driver should wait for a page to load before throwing a TimeoutException. For example to set timeout as 10 seconds, you can use <em>set_page_load_timeout(10)</em></p><p><strong>How long is Selenium timeout?</strong></p><p>The timeout in Selenium is set in seconds or milliseconds, depending on the method used. For example, <strong>the set_page_load_timeout()</strong> method in the WebDriver takes the timeout value in seconds, while the pause command in Selenium IDE takes the timeout value in milliseconds.</p><p>You can change the default timeout in Selenium by using the</p><p><strong>set_page_load_timeout</strong> method of the WebDriver object. For example:</p><p><strong><em>driver.set_page_load_timeout(10)</em></strong></p><p>You can also set a timeout for implicitly waiting for an element to be present on the page, using the <strong>implicitly_wait</strong>method.</p><blockquote>If a session runs for more than 7200 seconds (2 hours), the session is stopped, changing the status to TIMEOUT on the dashboard.</blockquote><h3>Thread.sleep()</h3><p>Sleep is a static method that belongs to the thread class. This method can be called using the reference of the class name i.e Thread. If you use <strong>Thread.sleep</strong> while performing automation testing with Selenium, then this method will stop the execution of the script for the specified duration of time, irrespective of whether the element is found or not on the web page. It accepts the time duration in milliseconds. The syntax for the same is:</p><p>Thread.sleep(3000);</p><p>The sleep function throws InterruptedException so it should be handled using a try-catch block as below:</p><pre>try{<br><br>Thread.sleep(5000);<br><br>}<br><br>catch(InterruptedException ie){<br><br>}</pre><p><strong>Used when we need to:</strong></p><ul><li>Detect sync issues</li><li>Count some time independently of application state or test flow</li><li>Freeze all java processes to see something in Debug mode</li></ul><h3>Explicit Wait</h3><p>The Explicit wait is another one of the dynamic Selenium waits. Explicit wait help to stop the execution of the script based on a certain condition for a specified amount of time. Once the time goes overboard, you will get the <strong>ElementNotVisibleException</strong>. In a scenario where you do not know the amount of time to wait for, this explicit wait comes in handy. Using conditions like <strong>elementToBeClickable()</strong> or <strong>textToBePresentInElement()</strong>, one can wait for the specified duration. One can use these predefined methods using the combination of classes WebDriverWait and ExpectedConditions. In order to use this case, import the below packages in your class:</p><pre>import org.openqa.selenium.support.ui.ExpectedConditions<br><br>import org.openqa.selenium.support.ui.WebDriverWait</pre><p>Post this one needs to create a reference variable for the WebDriverWait class and instantiate it using the WebDriver instance and providing the amount of Selenium wait for page load, one may need. The unit of time is in seconds. One can define it as below:</p><pre>WebDriverWait wait = new WebDriverWait(driver,30);</pre><p>In order to use the predefined methods of the ExpectedCondition Class, we will use the wait reference variable as below:</p><pre>wait.until(ExpectedConditions.visibilityOfElementLocated(Reference of Element to be  located using locator));**Types of Expected Conditions:**</pre><p><strong>Types of Expected Conditions:</strong></p><p>Below are the few types of expected conditions commonly used as you perform automation testing with Selenium.</p><ul><li><strong>visibilityOfElementLocated()-</strong> Verifies if the given element is present or not</li><li><strong>alertIsPresent()-</strong> Verifies if the alert is present or not.</li><li><strong>elementToBeClickable()-</strong> Verifies if the given element is present/clickable on the screen</li><li><strong>textToBePresentInElement()-</strong> Verifies the given element have the required text or not</li><li><strong>titlels()-</strong> Verify the condition wait for a page that has a given title</li></ul><p>There are many more expected conditions available, which you can refer through the <a href="https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html">Selenium official GitHub page</a>. Like Implicit wait, the explicit wait also keeps polling after every 500 milliseconds.</p><p><strong>Below is the code snippet highlighting the usage of an Explicit Selenium wait.</strong></p><pre>import java.util.concurrent.TimeUnit;<br><br>import org.openqa.selenium.By;<br>import org.openqa.selenium.JavascriptExecutor;<br>import org.openqa.selenium.WebDriver;<br>import org.openqa.selenium.chrome.ChromeDriver;<br>import org.openqa.selenium.support.ui.ExpectedConditions;<br>import org.openqa.selenium.support.ui.WebDriverWait;<br><br> <br>public class ExplicitWait {<br>    public static void main(String[] args) {<br><br>                System.setProperty(&quot;webdriver.chrome.driver&quot;, &quot;.\\Driver\\chromedriver.exe&quot;);<br>                WebDriver driver=new ChromeDriver();<br>                driver.manage().window().maximize();<br>                driver.get(&quot;https://www.rentomojo.com/&quot;);<br>                driver.findElement(By.xpath(&quot;//span[@class=&#39;rm-city__selectorBoxLoca&#39;][contains(text(),&#39;Delhi&#39;)]&quot;)).click();<br>                WebDriverWait wait=new WebDriverWait(driver, 120);<br>                wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath(&quot;//div[@class=&#39;Campaign__innerWrapper&#39;]/button&quot;))));<br>                driver.findElement(By.xpath(&quot;//div[@class=&#39;Campaign__innerWrapper&#39;]/button&quot;)).click();<br>    }<br>}</pre><blockquote>Note- When implicit wait and explicit wait are given in conjunction, then they work on cumulative time, rather than on a single wait condition</blockquote><h3>Implicit Wait</h3><p>Selenium has overcome the problems provided by Thread.sleep() and have come up with two Selenium waits for page load. One of which is Implicit wait which allows you to halt the WebDriver for a particular period of time until the WebDriver locates a desired element on the web page.</p><p>The key point to note here is, unlike Thread.sleep(), it does not wait for the complete duration of time. In case it finds the element before the duration specified, it moves on to the next line of code execution, thereby reducing the time of script execution. This is why Implicit wait is also referred to as dynamic wait. If it does not find the element in the specified duration, it throws <strong>ElementNotVisibleException</strong>.</p><p>Another interesting thing to note about Implicit wait is that it is applied globally, which makes it a better option than Thread.sleep(). Meaning you only need to write it one time and it gets applicable for all of the web elements specified on a script throughout the WebDriver instance. Convenient isn’t it? The syntax to achieve the same is:</p><pre>driver.manage().timeouts().implicitlyWait(Time Interval to wait for, TimeUnit.SECONDS);</pre><p>The default time for Implicit wait is zero and it keeps polling for the required element after every 500 milliseconds. Let’s see the code snippet below, showcasing the use of Implicit wait. In this example:</p><pre>import java.util.concurrent.TimeUnit;<br><br>import org.openqa.selenium.By;<br>import org.openqa.selenium.JavascriptExecutor;<br>import org.openqa.selenium.Keys;<br>import org.openqa.selenium.WebDriver;<br>import org.openqa.selenium.WebElement;<br>import org.openqa.selenium.chrome.ChromeDriver;<br>import org.openqa.selenium.support.ui.Select;  <br>import com.gargoylesoftware.htmlunit.javascript.background.JavaScriptExecutor;<br> <br>public class ImplicitWait {<br>    public static void main(String[] args) throws InterruptedException {<br>        System.setProperty(&quot;webdriver.chrome.driver&quot;, &quot;.\\Driver\\chromedriver.exe&quot;);<br>        WebDriver driver=new ChromeDriver();<br>        driver.manage().window().maximize();<br>        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);<br><br>        driver.get(&quot;https://www.easemytrip.com/&quot;);<br>        driver.findElement(By.id(&quot;FromSector_show&quot;)).sendKeys(&quot;Delhi&quot;, Keys.ENTER);<br>        driver.findElement(By.id(&quot;Editbox13_show&quot;)).sendKeys(&quot;Mumbai&quot;, Keys.ENTER);<br>        driver.findElement(By.id(&quot;ddate&quot;)).click();<br>        driver.findElement(By.id(&quot;snd_4_08/08/2019&quot;)).click();<br>        driver.findElement(By.className(&quot;src_btn&quot;)).click();<br>        driver.findElement(By.xpath(&quot;//button[text()=&#39;Book Now&#39;]&quot;)).click();<br><br>        JavascriptExecutor jse = (JavascriptExecutor)driver;<br><br>        jse.executeScript(&quot;window.scrollBy(0,750)&quot;);<br>        driver.findElement(By.xpath(&quot;//input[@type=&#39;email&#39;]&quot;)).sendKeys(&quot;sadhvisingh9049@gmail.com&quot;);<br>        driver.findElement(By.xpath(&quot;//span[text()=&#39;Continue Booking&#39;]&quot;)).click(); <br>        WebElement title=driver.findElement(By.id(&quot;titleAdult0&quot;));<br>        Select titleTraveller=new Select(title);<br>        titleTraveller.selectByVisibleText(&quot;MS&quot;);<br><br>        driver.findElement(By.xpath(&quot;//input[@placeholder=&#39;Enter First Name&#39;]&quot;)).sendKeys(&quot;Sadhvi&quot;);<br>        driver.findElement(By.xpath(&quot;//input[@placeholder=&#39;Enter Last Name&#39;]&quot;)).sendKeys(&quot;Singh&quot;);<br>        driver.findElement(By.xpath(&quot;//input[@placeholder=&#39;Mobile Number&#39;]&quot;)).sendKeys(&quot;9958468819&quot;);<br>        driver.findElement(By.xpath(&quot;//div[@class=&#39;con1&#39;]/span[@class=&#39;co1&#39;]&quot;)).click();<br><br>    }<br><br>}</pre><h3>The Difference Between Selenium Waits: Explicit Vs Implicit</h3><p>Now, since you are aware of the usage of implicit and explicit waits, let us investigate the difference between these 2 Selenium waits:</p><p><strong>Implicit Wait</strong></p><ul><li>It is by default applied to all the elements in the script.</li><li>We cannot wait based on a specified condition like element selectable/clickable unlike explicit.</li><li>It is usually used when you are sure the element may be visible in a certain time</li></ul><p><strong>Explicit Wait</strong></p><ul><li>It is applicable to only a certain element which is specific to a certain condition.</li><li>In explicit, we can specify the wait based on a specific condition.</li><li>It is usually used, when you are not aware of the time of the element visibility. It is subjected to dynamic nature.</li></ul><h3>Fluent Wait</h3><p>The Fluent wait is similar to explicit wait in terms of its functioning. In Fluent wait, you perform a Selenium wait for an element when you are not aware of the time it may take to be visible or clickable. The few differential factors that Fluent wait offers are:</p><ul><li><strong>The polling frequency-</strong> In case of Explicit wait, this polling frequency is by default 500 milliseconds. Using Fluent wait, you can change this polling frequency based on your needs, i.e you can tell your script to keep checking on an element after every ‘x’ seconds.</li><li><strong>Ignore Exception-</strong> During polling, in case you do not find an element, you can ignore any exception like ‘NoSuchElement’ exception etc.</li></ul><p>Apart from these differential factors, like Explicit wait or Implicit wait, you can define the amount of time to wait for the element to be visible or actionable. The below syntax or lines of code are used to define Fluent wait in Selenium:</p><pre>Wait&lt;WebDriver&gt; fluentWait = new FluentWait&lt;WebDriver&gt;(driver)<br><br>       .withTimeout(60, SECONDS)<br><br>       .pollingEvery(2, SECONDS)<br><br>       .ignoring(NoSuchElementException.class);<br><br>      WebElement foo = fluentWait.until(new Function&lt;WebDriver, WebElement&gt;() {<br><br>     public WebElement apply(WebDriver driver)  <br><br>     {  return driver.findElement(By.id(&quot;foo&quot;));<br><br>}});</pre><p>the major difference between the Explicit wait and the Fluent wait is, that the Explicit Selenium Wait provides predefined conditions, which are applied on elements we need to wait for, whereas, in case of Fluent Selenium wait, you can define your own customized conditions within the apply method.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d471b7dbeca" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>