close

Вход

Забыли?

вход по аккаунту

?

Part1 My

код для вставкиСкачать
An introduction to Test Automation Denys Zaiats
Type of testing
•
Desktop application
•
Web
-
application
•
Web
-
services
•
Data Base Different scripting approaches •
Record and playback •
Linear scripting •
Modular scripting •
Data
-
driven testing •
Keyword
-
driven testing Record and playback •
Capture interaction with system and replay it •
Popular approach among commercial tools Record and playback: Benefits •
Very easy and fast to create initially •
No programming skills needed Record and playback: Problems •
Does not test anything unless checkpoints added •
Very fragile 1.
Often single change in UI can break all tests •
Hard to maintain 1.
Plenty of separate test scripts 2.
No modularity or reuse •
System must be ready before automation can start
1.
Does not support acceptance test driven development (ATDD) Linear scripting •
Non
-
structured scripts interact directly with the system under test (SUT) •
Can use any programming language
•
Also produced by capture and replay tools Linear scripting: Example import unittest
from selenium import webdriver
class Login(
unittest.TestCase
):
def
setUp
(self):
self.driver
= webdriver.Firefox
()
def
tearDown
(self):
self.driver.quit
()
def
test_login
(self):
driver = self.driver
driver.get
('http://
testurl
')
username = driver.find_element_by_name
('
user_id
'
)
submit_button
= driver.
find_element_by_xpath
(“//a*contains(@class,’a1’)+”)
username.send_keys
('admin'
)
submit_button.click
()
Linear scripting: Benefits •
Fast to create initially •
Flexible •
Can use common scripting languages •
No license costs Data
-
driven testing •
Test data taken out of test scripts •
Customarily presented in tabular format
•
One driver script can execute multiple similar tests •
New driver script still needed for different kinds of tests
Data
-
driven testing: Example Test Case
Number
1
Operation
Number
2
Expected
TC1
1
+
3
4
TC2
2
*
4
8
Keyword
-
driven testing •
Not only test data but also directives (keywords) telling how to use the data taken out of the test scripts •
Keywords and the test data associated with them drive test execution Keyword
-
driven testing: Example Action
Selector
Data
insertText
#
example_id
Test_Text
Generic skills to learn •
Scripting languages (
Python, Java, C#, Javascript
, ... )
•
Regular expressions •
XPath
and CSS selectors •
SQL •
Using version control Tools for automation testing
•
Selenium (IDE, driver) –
Web application
•
Apache Jmeter
(Performance, Load testing) –
Web services
•
Test complete –
Desktop + Web
•
QTP –
Desktop + Web
•
Silk Test –
Desktop + Web
•
AutoIT
–
Desktop (Windows)
•
White –
Desktop (Windows)
•
Automator
–
(Mac OS)
•
Silkuli
–
cross
-
platform
Автор
tlytvyn
Документ
Категория
Презентации
Просмотров
32
Размер файла
83 Кб
Теги
part1_my
1/--страниц
Пожаловаться на содержимое документа