<?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 Dennis on Medium]]></title>
        <description><![CDATA[Stories by Dennis on Medium]]></description>
        <link>https://medium.com/@a0976278215?source=rss-45b5e7aaf084------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*8LTnmmDsM0hJ6dS2</url>
            <title>Stories by Dennis on Medium</title>
            <link>https://medium.com/@a0976278215?source=rss-45b5e7aaf084------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 09:13:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a0976278215/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[QA Engineer Internship Series (Part 2): Building Reliable Selenium Tests with Pytest Fixtures]]></title>
            <link>https://medium.com/@a0976278215/qa-engineer-internship-series-part-2-building-reliable-selenium-tests-with-pytest-fixtures-97460afb3df7?source=rss-45b5e7aaf084------2</link>
            <guid isPermaLink="false">https://medium.com/p/97460afb3df7</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Dennis]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 07:52:06 GMT</pubDate>
            <atom:updated>2026-07-26T07:52:06.196Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Problem: Tests That Secretly Depend on Each Other</h3><p>Say you’re testing the “delete case” feature. The obvious flow looks like this:</p><ol><li>Log in</li><li>Create a case</li><li>Delete that case</li><li>Verify results</li></ol><p>Seems fine, right? Here’s the problem you may face: what if the <strong>“create case”</strong> feature itself is broken that day? Your delete-case test will fail too — even though delete case is working perfectly. The failure has nothing to do with the thing you’re actually trying to test.</p><p>This is exactly the trap <strong>setup and teardown</strong> exist to prevent: keeping tests independent of each other, so one broken feature doesn’t cause a cascade of unrelated test failures.</p><h3>The Pattern: Create → Test → Clean Up</h3><p>The standard flow for automated tests becomes:</p><ol><li><strong>Set up</strong> — create whatever data the test needs</li><li><strong>Run</strong> — execute the actual test logic</li><li><strong>Tear down</strong> — delete that data afterward</li></ol><p>This keeps your test environment clean every time, unaffected by leftover data from previous runs.</p><h3>Example:</h3><pre>from apis.api_create_case import api_create_case<br>import config<br>import pytest<br>from apis.api_delete_case import api_delete_case<br>from apis.api_search_case import api_search_case<br>from pages.case_overview_page import CaseOverviewPage<br>from utils.random_util import generate_random_string<br>CASE_NAME = generate_random_string(prefix=&quot;test&quot;)<br><br>@pytest.fixture(scope=&quot;function&quot;)<br>def setup_and_teardown_search_case(driver):<br>    payload = {&quot;caseInfoName&quot;: CASE_NAME}<br>    api_create_case(payload)<br>    yield<br>    case_list = api_search_case()[&quot;rows&quot;]<br>    case_id_list = [id[&quot;caseInfoId&quot;] for id in case_list]<br>    api_delete_case(case_id_list)<br><br>def test_search_case(driver, setup_and_teardown_search_case):<br>    driver.get(config.BASE_FRONTED_URL + &quot;/case_overview&quot;)<br>    case_overview_page = CaseOverviewPage(driver)<br>    case_overview_page.enter_search_keyword(CASE_NAME)<br>    assert case_overview_page.is_case_name_visible(CASE_NAME)</pre><p>The yield statement is the dividing line:</p><ul><li><strong>Everything before </strong><strong>yield</strong> runs first — this is setup. It executes before test_search_case starts.</li><li><strong>Everything after </strong><strong>yield</strong> runs last — this is teardown. It executes after the test finishes, regardless of whether it passed or failed.</li></ul><p>So the full lifecycle for this test is: <strong>create a case → run the search test → delete the case.</strong></p><h3>Choosing a Scope</h3><p>Fixtures can run at different scopes depending on how long the data needs to live:</p><ul><li><strong>function scope</strong> — data is created fresh for <em>every single test</em> and torn down right after. This is the most common choice in real-world projects, since it guarantees full isolation between tests.</li><li><strong>session scope</strong> — data is created once and shared across an entire test run. Useful when setup is expensive and doesn&#39;t need to be repeated per test, but riskier for isolation.</li></ul><p>In practice, function scope is the safer default unless you have a good reason to share state.</p><h3>How Should You Actually Write Setup and Teardown?</h3><p>At this point you might be wondering: do I need to write Selenium UI logic just to create and delete test data? Thankfully, no — this is where calling the backend API directly comes in handy. Python’s requests library makes this straightforward.</p><h3>Example: Creating a Case via API</h3><pre>import requests<br>import config<br>def api_create_case(payload):<br>    request_url = f&quot;http://localhost:3000/case&quot;<br>    response = requests.post(<br>        url=request_url,<br>        json=payload,<br>        timeout=config.TIMEOUT<br>    )<br>    if response.status_code == 200:<br>        return response.json()<br>    else:<br>        return None</pre><p>The core logic of using requests boils down to three things:</p><ol><li><strong>Define the URL</strong> you’re calling</li><li><strong>Choose the right HTTP method</strong> — GET to read, POST to create, PUT/PATCH to update (both need a payload), DELETE to remove</li><li><strong>Handle both outcomes</strong> — decide what your function returns on success versus failure</li></ol><p>To sum up,Going through the API instead of the UI to set up and tear down test data has a real practical benefit too: it’s faster than clicking through the browser, and it decouples your data setup from the very UI elements.</p><h3>Conclusion:</h3><p>By using pytest fixtures with setup and teardown processes, we can manage test data more efficiently.In the next article, I will share some challenges I encountered while working with Selenium, including common issues, debugging approaches, and lessons learned from troubleshooting real-world automation tests.Stay tuned for the next part of my QA Engineer Internship Series.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97460afb3df7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[QA Engineer Internship Series (Part 1): Building Maintainable Selenium Tests with the Page Object…]]></title>
            <link>https://medium.com/@a0976278215/qa-engineer-internship-series-part-1-building-maintainable-selenium-tests-with-the-page-object-77efe325f25a?source=rss-45b5e7aaf084------2</link>
            <guid isPermaLink="false">https://medium.com/p/77efe325f25a</guid>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Dennis]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 13:49:47 GMT</pubDate>
            <atom:updated>2026-07-22T13:49:47.639Z</atom:updated>
            <content:encoded><![CDATA[<h3>QA Engineer Internship Series (Part 1): Building Maintainable Selenium Tests with the Page Object Model</h3><p>During my QA internship, I thought writing Selenium automation tests would be straightforward. Opening a page.Finding an element. Clicking a button. Verifying the result. My first few test cases worked perfectly. Then our frontend changed a single button ID.Suddenly, several tests failed at once.</p><p>That assumption fell apart fast.</p><h3>The Textbook Approach:</h3><p>This was exactly how I learned Selenium in class.</p><pre>from selenium import webdriver<br>from selenium.webdriver.common.by import By<br>from selenium.webdriver.support.ui import WebDriverWait<br>from selenium.webdriver.support import expected_conditions as EC<br>def test_login():<br>    driver = webdriver.Chrome()<br>    driver.get(&quot;http://example.com/login&quot;)<br>    wait = WebDriverWait(driver, 10)<br>    # Find email input<br>    email_input = driver.find_element(by=By.ID, value=&quot;socialWorkerEmail&quot;)<br>    # Find password input<br>    password_input = driver.find_element(by=By.ID, value=&quot;socialWorkerPassword&quot;)<br>    # Find login button<br>    login_button = driver.find_element(by=By.ID, value=&quot;login-button&quot;)<br>    # Perform login actions<br>    email_input.send_keys(&quot;test5@gmail.com&quot;)<br>    password_input.send_keys(&quot;555&quot;)<br>    login_button.click()<br>    # Verify success message<br>    success_message = wait.until(<br>        EC.visibility_of_element_located((By.CLASS_NAME, &quot;alert-success&quot;))<br>    )<br>    assert success_message.is_displayed()<br>    driver.quit()</pre><p>It looks clean enough, and for a toy project it works fine. But scale this pattern up to a real production codebase, and two problems show up quickly:</p><ul><li><strong>Poor maintainability.</strong> The moment that the UI changes even slightly, you end up editing <em>every single test file</em> that touches that element.</li><li><strong>Low reusability.</strong> Element locators, actions, and assertions are all tangled together in one function. Everything is tightly coupled, so nothing is reusable.</li></ul><h3>Page Object Model (POM)</h3><p>This is exactly the problem the Page Object Model was designed to solve. If you’ve studied object-oriented programming, the idea l feel familiar: treating each web page as its own object. Element locators become the object’s <em>properties</em>, and user interactions become the object’s <em>methods</em>.</p><p>Your test files no longer touch the DOM directly — they just call page methods. The payoff: when a frontend engineer changes the UI, you only need to update the corresponding page object and don’t need to update the test script.</p><h3>Project Structure</h3><p>A typical POM project is organized like this:</p><ul><li><strong>tests/</strong> — the actual test files</li><li><strong>pages/</strong> — one class per page, encapsulating its locators and actions</li><li><strong>components/</strong> — reusable pieces used <em>within</em> pages (modals, dropdowns, alerts, etc.)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*ggpCJw4KP5oC3wwiP-CMtg.png" /></figure><h3>Step 1: A Base Page</h3><p>Every page object inherits from a shared BasePage, which handles WebDriver setup:</p><pre>from selenium.webdriver.support.ui import WebDriverWait<br>import config<br>class BasePage:<br>    def __init__(self, driver):<br>        &quot;&quot;&quot;<br>        Initializes the BasePage with the provided WebDriver instance.<br>        Args:<br>            driver (WebDriver): The WebDriver instance to control the browser.<br>        &quot;&quot;&quot;<br>        self.driver = driver<br>        self.wait = WebDriverWait(self.driver, config.TIMEOUT)</pre><h3>Step 2: A Page Object</h3><p>Each page class defines its own locators and the actions a user can take on it(here is the page for example):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61a4Det6hAVc8EtrZJMXXQ.png" /></figure><pre>from selenium.webdriver.common.alert import Alert<br>from components.common.alert_message import AlertMessage<br>from pages.add_case_page import CaseInfoPage<br>from pages.common.base_page import BasePage<br>from selenium.webdriver.common.by import By<br>from selenium.webdriver.support import expected_conditions as EC<br>class CaseOverviewPage(BasePage):<br>    SEARCH_BAR = (By.ID, &quot;search-bar&quot;)<br>    ADD_CASE_BUTTON = (By.ID, &quot;add-case-button&quot;)<br>    DELETE_BUTTON = (By.ID, &quot;delete-button&quot;)<br><br>    def enter_search_keyword(self, keyword):<br>        &quot;&quot;&quot;Enter a search keyword into the search bar.&quot;&quot;&quot;<br>        search_input = self.wait.until(EC.element_to_be_clickable(self.SEARCH_BAR))<br>        search_input.clear()<br>        search_input.send_keys(keyword)<br>    def click_add_case(self):<br>        &quot;&quot;&quot;Click the &#39;Add Case&#39; button to create a new case.&quot;&quot;&quot;<br>        self.wait.until(EC.element_to_be_clickable(self.ADD_CASE_BUTTON)).click()<br>        return CaseInfoPage(self.driver)<br>    def click_delete_button(self):<br>        &quot;&quot;&quot;Click the delete button and return the resulting alert component.&quot;&quot;&quot;<br>        self.wait.until(EC.element_to_be_clickable(self.DELETE_BUTTON)).click()<br>        return AlertMessage(self.driver)</pre><p>Notice that click_add_case() returns a CaseInfoPage object. This is a common POM convention: when an action navigates to a new page, the method returns <em>that page&#39;s object</em>, so your test can keep chaining calls fluently.</p><h3>Step 3: The Test Itself</h3><p>With the page objects in place, the test reads almost like plain English:</p><pre>import time<br>import config<br>import pytest<br>from apis.api_delete_case import api_delete_case<br>from apis.api_search_case import api_search_case<br>from pages.case_overview_page import CaseOverviewPage<br>from utils.random_util import generate_random_string<br>CASE_NAME = generate_random_string(prefix=&quot;test&quot;)<br><br>@pytest.fixture<br>def setup_and_teardown_create_case(driver):<br>    yield<br>    case_list = api_search_case()[&quot;rows&quot;]<br>    case_id_list = [id[&quot;caseInfoId&quot;] for id in case_list]<br>    api_delete_case(case_id_list)<br><br>def test_create_case(driver, setup_and_teardown_create_case):<br>    driver.get(config.BASE_FRONTED_URL + &quot;/case_overview&quot;)<br>    case_overview_page = CaseOverviewPage(driver)<br>    add_case_page = case_overview_page.click_add_case()<br>    add_case_page.enter_case_name(&quot;test_case&quot;)<br>    add_case_page.enter_case_gender(&quot;Male&quot;)<br>    add_case_page.enter_case_info_welfare_proof(&quot;Yes&quot;)<br>    add_case_page.enter_case_info_live_status(&quot;Renting&quot;)<br>    success_alert = add_case_page.click_submit_button()<br>    assert success_alert.is_success_alert_visible()</pre><p>Comparing this to the wall of find_element calls from the textbook example. There&#39;s no locator noise, no repeated boilerplate — just a readable sequence of user actions. All the messy detail (IDs, waits, XPath) lives safely inside the page objects, one layer down.</p><h3><strong>Conclusion</strong></h3><p>This is my first article in my QA Engineer Internship Series. If you are interested in what I learn in<strong> </strong>QA Engineer, you can follow me and give me claps as support.In the next article, I’ll share how I used Pytest Fixtures to isolate test cases and simplify test setup.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77efe325f25a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[115資管所考試心得（無補習）]]></title>
            <link>https://medium.com/@a0976278215/115%E8%B3%87%E7%AE%A1%E6%89%80%E8%80%83%E8%A9%A6%E5%BF%83%E5%BE%97-%E7%84%A1%E8%A3%9C%E7%BF%92-e124859c0c9d?source=rss-45b5e7aaf084------2</link>
            <guid isPermaLink="false">https://medium.com/p/e124859c0c9d</guid>
            <dc:creator><![CDATA[Dennis]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 11:10:53 GMT</pubDate>
            <atom:updated>2026-07-22T11:10:53.003Z</atom:updated>
            <content:encoded><![CDATA[<p>考試基本上都已經放榜了，在版上看很多歷届資管所學長姐考試心得分享，因此特地發一篇文來回饋學弟妹，供大家參考。先説説我的背景</p><p>【背景】 學校：新莊大學</p><p>趴數：三十多快四十趴</p><p>專題*2</p><p>實習*1</p><p>資訊服務創新競賽佳作</p><p>多益：765</p><p>【成績】</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eshAi9Cp7_LyWNPP.jpeg" /></figure><p>【考試準備】 本來想説大三下想要準備推甄的，但看完板上歷届學長姐心得分享如果要中字備等級以上基本上要書卷獎等級才有可能，加上又是一名學店生，背景資料也不是特別的占有優勢因此果斷放棄推甄這條路，就全新全意準備考試這條路，讓自己以後不會後悔。 本來有去試聽補習班的課程，但聽著聽著發現到補習班的課程教學風格不太符合我的胃口，而且補習費又很貴，有可能會答不到我想要的結果，因此不選擇補習，取而代之的是在網路上買補習班的二手書自己讀，並搭配chatgpt。我補習一共分爲四個時段：</p><p><strong>大三下（3~7）</strong>：這個時間段基本上沒什麽讀書，主要是忙學校課業，和專題，讀書時間段主要集中在周末以及晚上，因此主要是復習我大學所學的知識，主要看資料結構，作業系統和網路，回顧大學所學的内容（這裏主要推薦清大黃能富的網路概論，以及陳士傑的作業系統和資料結構，這兩個好好看我相信能打下不錯的基礎）</p><p><strong>大三升大四（7~9）</strong>：這段時間學校課業也都忙的差不多了，所以讀書時間也隨之增加（一天大約5~6小時），這段時間主要是寫當初買的二手題本，開始瞭解到實際考試會怎麽出題，將自己的不會的概念手寫記下來，提醒自己下次遇到類似的觀念不會出錯，閑暇時間做做leetcode 題目（建議做neetcode 150，已涵蓋大部分手寫程式考點）培養自己程式能力和資料結構概念</p><p><strong>大四上學期（9~12）</strong>：大四上由於需要花蠻多時間準備資服競賽的東西，在加上又要騰出一定量的時間給考試，因此基本上都修最低學分，這時期除了花時間看AI 機器學習内容，同時也開始看考古題了，自己深知考古題越早看越能知道各個學校的考試重點，像中央偏愛作業系統，網路。政大會考手寫程式，實作能力那些。</p><p><strong>大四上寒假（12~2）</strong>：屬於最後衝刺期了，因此開始瘋狂寫考古題，訂正加復習，基本上我認爲相似的概念，在最後考試是會再次出現的</p><p>【政大面試分享】 程式語言關卡： 程式有分為多個function,教授會問你這個function主要在做什麽，會要你一步步算結果並搶答，我這關有稍微答出來，但答得不是很完整 英文閲讀： 開始面試前，會進入到小房間抽文章，並給你10分鐘做筆記，正式面試時，不曉得是太緊張還是怎麽樣，也沒有很聽懂教授想問我什麽，感覺是要我用英文解釋裏面的某個名詞，剛好筆記沒做到也沒想到問這個，卡詞卡很久，最後教授受不了叫我用中文（可能這關太糟糕了，應該是面試低分主要原因） 研究計劃： 這個關卡似乎和以往的模式不同，以前會問你寫的研究計劃，這次則是有三個題目要我們抽，我們抽到的是關於聯邦學習的内容，這部分答得平平，只回答到共享模型權重，但數據不離開本地這一塊，之後還問們聯邦學習的裏面技術細節及優缺點，但我們這組答得不是很完整（應該又扣了不少分數）</p><p>【感謝，最後心得】 這次考研最遺憾的就是沒上政大了，它是我的第一志願，沒想到敗在面試這個關卡上，建議在讀書的同時，可能也需要抽空練練英文口語表達，不要像我到面試考場上跟小丑一樣。 最後感謝系上教授願意給我寫推薦信，以及專題組員（讓我備審資料不至於這麽空白），也感謝神明讓我在考試當下運氣還不錯，爸爸媽媽無限支持我，也感謝自己能堅持到最後一刻。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e124859c0c9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>