0
0
Postmantesting~10 mins

Workspace organization in Postman - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test verifies that a user can successfully create a new workspace in Postman and that the workspace appears in the workspace list.

Test Code - Selenium with Python unittest
Postman
import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

class TestPostmanWorkspaceCreation(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.driver.get('https://web.postman.co/')
        self.wait = WebDriverWait(self.driver, 10)
        # Assume user is already logged in for simplicity

    def test_create_workspace(self):
        driver = self.driver
        wait = self.wait

        # Click on workspace dropdown
        workspace_dropdown = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, 'button[aria-label="Workspace selector"]')))
        workspace_dropdown.click()

        # Click on 'Create Workspace' button
        create_workspace_btn = wait.until(EC.element_to_be_clickable((By.XPATH, '//button[contains(text(), "Create Workspace")]')))
        create_workspace_btn.click()

        # Enter workspace name
        name_input = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, 'input[placeholder="Workspace name"]')))
        workspace_name = 'Test Workspace'
        name_input.send_keys(workspace_name)

        # Select workspace type (Personal)
        personal_radio = wait.until(EC.element_to_be_clickable((By.XPATH, '//label[contains(text(), "Personal")]')))
        personal_radio.click()

        # Click 'Create Workspace' confirm button
        confirm_btn = wait.until(EC.element_to_be_clickable((By.XPATH, '//button[contains(text(), "Create Workspace")]')))
        confirm_btn.click()

        # Verify new workspace appears in workspace list
        workspace_dropdown.click()
        workspace_list = wait.until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, 'div[role="list"] div[role="listitem"]')))
        workspace_names = [item.text for item in workspace_list]
        self.assertIn(workspace_name, workspace_names)

    def tearDown(self):
        self.driver.quit()

if __name__ == '__main__':
    unittest.main()
Execution Trace - 7 Steps
StepActionSystem StateAssertionResult
1Test starts and opens Chrome browser to Postman web appBrowser opened at https://web.postman.co/ with login page or main page-PASS
2Clicks on workspace dropdown button to open workspace listWorkspace dropdown menu is visible-PASS
3Clicks on 'Create Workspace' button in dropdownCreate Workspace modal/dialog appears-PASS
4Enters 'Test Workspace' into workspace name input fieldInput field contains 'Test Workspace'-PASS
5Selects 'Personal' workspace type radio button'Personal' option is selected-PASS
6Clicks 'Create Workspace' confirm buttonModal closes, workspace is created-PASS
7Clicks workspace dropdown again to refresh workspace listWorkspace dropdown menu is visible with updated listCheck if 'Test Workspace' is in the workspace listPASS
Failure Scenario
Failing Condition: The 'Create Workspace' button is not clickable or workspace name input is missing
Execution Trace Quiz - 3 Questions
Test your understanding
What is the first action performed after opening the Postman web app?
AClick 'Create Workspace' button
BClick the workspace dropdown button
CEnter workspace name
DSelect workspace type
Key Result
Always wait explicitly for UI elements to be present and clickable before interacting to avoid flaky tests.