- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Good example of functional testing a Python Tkinter application
Let us suppose that we have a GUI-based Python tkinter application that takes the text input from the user and validates by saving it in a new text file. The file contains the same text input that the user has typed. We can check and validate the user input from the file.
In Functional Testing, we are primarily concerned about backend API, database, user-server communication, Input and output, etc.
To check the application using the functional testing strategy, we have to first understand the user requirement and the input/output. After testing the pre-phase, we test our application for different test cases.
For example, we have a GUI-based tkinter application that takes the user input and saves it in the form of a text file in the system.
from tkinter import * win = Tk() win.geometry("700x600") # Create title label title_label = Label(win, text="Enter the File Name") title_label.pack(anchor='n') # Create title entry title_entry = Entry(win, width=35) title_entry.pack(anchor='nw') # Create save button and function def save(): # Get contents of title entry and text entry # Create a file to write these contents in to it file_title = title_entry.get() file_contents = text_entry.get(0.0, END) with open(file_title + ".txt", "w") as file: file.write(file_contents) print("File successfully created") file.close() pass #Create a save button to save the content of the file save_button = Button(win, text="Save The File", command=save) save_button.pack() # Create text entry text_entry = Text(win, width=40, height=30, border=4, relief=RAISED) text_entry.pack() win.mainloop()
Running the above code will create a window like this,
Once we will click the Save the File button, it will save the filename as “Tutorials.txt”.
Now, go to the file location and open the text file externally. It will have the same text as the user input.
- What is non functional testing example
- What is Non-Functional Testing? Types with Example
- Difference between Functional and Non-functional Testing.
- what is functional testing in QA
- Banking Domain Application Testing
- Web Application Testing Checklist
- Web Application Testing Guide
- How to bundle a Python Tkinter application including dependencies?
- What is Functional Testing (Types & Examples)?
- Best Web Application Testing Tools
- What is the role of test automation in functional testing?
- 20 Best Web Application Testing Tools
- Path Testing & Basis Path Testing with Example
- How to create a borderless fullscreen application using Python-3 Tkinter?
- Creating Tkinter full-screen application