معرفی کتاب «Learning Selenium Testing Tools with Python: A practical guide on automated web testing with Selenium using Python» نوشتهٔ Unmesh Gundecha، منتشرشده توسط نشر Packt Publishing Limited در سال 2014. این کتاب در 5 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «Learning Selenium Testing Tools with Python: A practical guide on automated web testing with Selenium using Python» در دستهٔ بدون دستهبندی قرار دارد.
A practical guide on automated web testing with Selenium using Python If you are a quality testing professional, or a software or web application developer looking to create automation test scripts for your web applications, with an interest in Python, then this is the perfect guide for you. Python developers who need to do Selenium testing need not learn Java, as they can directly use Selenium for testing with this book. Selenium WebDriver is a popular automated testing tool for web applications. Python is one of the top programming languages and when used with Selenium it can automate and test web applications. Using Python's unittest module, you can write test cases in Selenium. Over the years, Selenium has become a very powerful testing platform and many organizations are adopting Selenium WebDriver for creating automated user interface tests. The book's main aim is to cover the fundamentals related to Python Selenium testing. You will learn how the Selenium WebDriver Python API can be integrated with CI and Build tools to allow tests to be run while building applications. This book will guide you through using the Selenium WebDriver Python client library as well as other tools from the Selenium project. Towards the end of this book, you'll get to grips with Selenium Grid, which is used for running tests in parallel using nodes for cross-browser testing. It will also give you a basic overview of the concepts, while helping you improve your practical testing skills with Python and Selenium. Learning Selenium Testing Tools with Python 8 Credits 9 About the Author 10 About the Reviewers 11 www.PacktPub.com 13 Support files, eBooks, discount offers, and more 14 Why subscribe? 15 Free access for Packt account holders 16 Preface 17 What this book covers 18 What you need for this book 20 Who this book is for 21 Conventions 22 Reader feedback 23 Customer support 24 Downloading the example code 25 Errata 26 Piracy 27 Questions 28 1. Getting Started with Selenium WebDriver and Python 29 Preparing your machine 30 Installing Python 31 Installing the Selenium package 32 Browsing the Selenium WebDriver Python documentation 33 Selecting an IDE 34 PyCharm 34 The PyDev Eclipse plugin 36 PyScripter 36 Setting up PyCharm 38 Taking your first steps with Selenium and Python 41 Cross-browser support 46 Setting up Internet Explorer 47 Setting up Google Chrome 50 Summary 52 2. Writing Tests Using unittest 53 The unittest library 54 The TestCase class 56 The setUp() method 56 Writing tests 56 Cleaning up the code 57 Running the test 58 Adding another test 59 Class-level setUp() and tearDown() methods 61 Assertions 63 Test suites 64 Generating the HTML test report 67 Summary 69 3. Finding Elements 70 Using developer tools to find locators 72 Inspecting pages and elements with Firefox using the Firebug add-in 73 Inspecting pages and elements with Google Chrome 75 Inspecting pages and elements with Internet Explorer 77 Finding elements with Selenium WebDriver 78 Using the find methods 79 Finding elements using the ID attribute 79 Finding elements using the name attribute 80 Finding elements using the class name 80 Finding elements using the tag name 81 Finding elements using XPath 82 Finding elements using CSS selectors 83 Finding links 85 Finding links with partial text 85 Putting all the tests together using find methods 87 Summary 90 4. Using the Selenium Python API for Element Interaction 91 Elements of HTML forms 92 Understanding the WebDriver class 93 Properties of the WebDriver class 94 Methods of the WebDriver class 95 Understanding the WebElement class 96 Properties of the WebElement class 97 Methods of the WebElement class 98 Working with forms, textboxes, checkboxes, and radio buttons 99 Checking whether the element is displayed and enabled 101 Finding the element attribute value 102 Using the is_selected() method 103 Using the clear() and send_keys() methods 104 Working with dropdowns and lists 107 Understanding the Select class 108 Properties of the Select class 109 Methods of the Select class 110 Working with alerts and pop-up windows 112 Understanding the Alert class 113 Properties of the Alert class 114 Methods of the Alert class 115 Automating browser navigation 117 Summary 119 5. Synchronizing Tests 120 Using implicit wait 121 Using explicit wait 123 The expected condition class 125 Waiting for an element to be enabled 127 Waiting for alerts 128 Implementing custom wait conditions 130 Summary 131 6. Cross-browser Testing 132 The Selenium standalone server 133 Downloading the Selenium standalone server 134 Launching the Selenium standalone server 135 Running a test on the Selenium standalone server 137 Adding support for Internet Explorer 140 Adding support for Chrome 141 Selenium Grid 142 Launching Selenium server as a hub 143 Adding nodes 145 Adding an IE node 145 Adding a Firefox node 146 Adding a Chrome node 146 Mac OS X with Safari 148 Running tests in Grid 149 Running tests in a cloud 151 Using Sauce Labs 152 Summary 155 7. Testing on Mobile 156 Introducing Appium 157 Prerequisites for Appium 158 Setting up Xcode for iOS 158 Setting up Android SDK 159 Setting up the Appium Python client package 160 Installing Appium 161 Appium Inspector 165 Testing on iOS 166 Writing a test for iOS 167 Testing on Android 169 Writing a test for Android 170 Using Sauce Labs 174 Summary 176 8. Page Objects and Data-driven Testing 177 Data-driven testing 178 Using ddt for data-driven tests 179 Installing ddt 180 Creating a simple data-driven test with ddt in unittest 181 Using external data sources for data-driven tests 183 Reading values from CSV 184 Reading values from Excel 186 The page objects pattern 188 Organizing tests 190 The BasePage object 191 Implementing page objects 192 Creating a test with page objects 195 Summary 196 9. Advanced Techniques of Selenium WebDriver 197 Methods for performing keyboard and mouse actions 198 Keyboard actions 200 The mouse movement 202 The double_click method 202 The drag_and_drop method 203 Executing JavaScript 205 Capturing screenshots of failures 207 Recording a video of the test run 209 Handling pop-up windows 212 Managing cookies 214 Summary 216 10. Integration with Other Tools and Frameworks 217 Behavior-Driven Development 218 Installing Behave 219 Writing the first feature in Behave 220 Implementing a step definition file for the feature 220 Creating environment configurations 221 Running features 222 Using a scenario outline 222 CI with Jenkins 225 Preparing for Jenkins 226 Setting up Jenkins 227 Summary 234 Index 235
Selenium WebDriver is a popular automated testing tool for web applications. Python is one of the top programming languages and when used with Selenium it can automate and test web applications. Using Python's unittest module, you can write test cases in Selenium. Over the years, Selenium has become a very powerful testing platform and many organizations are adopting Selenium WebDriver for creating automated user interface tests.
The book's main aim is to cover the fundamentals related to Python Selenium testing. You will learn how the Selenium WebDriver Python API can be integrated with CI and Build tools to allow tests to be run while building applications. This book will guide you through using the Selenium WebDriver Python client library as well as other tools from the Selenium project. Towards the end of this book, you'll get to grips with Selenium Grid, which is used for running tests in parallel using nodes for cross-browser testing. It will also give you a basic overview of the concepts, while helping you improve your practical testing skills with Python and Selenium.