-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathReadme.txt
More file actions
235 lines (168 loc) · 7.86 KB
/
Readme.txt
File metadata and controls
235 lines (168 loc) · 7.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
Selenium-Exercise
------------Basics of Selenium------------
If you want to create robust, browser-based regression automation suites and tests,
scale and distribute scripts across many environments, then you want to use Selenium WebDriver,
a collection of language specific bindings to drive a browser - the way it is meant to be driven.
Get Started
• Initialize
• Title
• Methods
• Locators
• XpathAndCSS (Advanced)
Web Element
• StaticDropdown
• UpdatedStaticDropdown
• DynamicDropdown
• AutosuggestiveDropdown
• Checkbox
• CheckboxAssignment
• RadioButton
• CurrentDate
• EndToEnd
• HandlingAlertPopup
• Assignment2
• Calendar
• Calendar1
• AutosuggestiveDropdownAdvance (Using getAttribute method)
• AutosuggestiveDropdownAdvance1 (Using JavascriptExecutor)
• Assignment8
Functional Testing
• ListElement
• ArrayList
• ArrayList1
• ArrayList2
Synchronization
• ImplicitWait
• ExplicitWait
• FluentWait
• Assignment3
Actions
• MouseInteractions
• KeyboardInteractions
Window (Window/tab Swtich)
• WindowMethod
• WindowSwitch
• Assignment4
Frame
• Frame
• DragAndDrop (Used with Action Class)
• Assignment5
Exercise
• ScopeLimiting
• ChildWindowTitle (Get title of all child window)
• Assignment6
Table
• Table
• Table1
• Assignment7
• AscendingList SortTable (Using Array list & Collection Framework)
• DescendingList SortTable (Using Array list & Collection Framework)
Miscellaneous
• HandlingCookie
• HandlingSSLCertification HTTP/HTTPS (DesiredCapabilities + ChromeOptions)
• TakesScreenshot getScreenshotAs(OutputType.FILE);
------------Grid------------
If you want to scale by distributing and running tests on several machines and manage multiple environments
from a central point, making it easy to run the tests against a vast combination of browsers/OS,
then you want to use Selenium Grid.
Steps
• Setup for Hub
Download Selenium Server (Grid) jar
Link -> https://www.selenium.dev/downloads/
Open cmd and start the Hub
Command -> C:\Selenium>java -jar selenium-server-standalone-3.141.59.jar -role hub
(path>java -jar jarfilename.jar -role rolename)
Get ip address of Hub so Nodes can register with Hub
Open Browser and enter in search box
Enter -> ipaddress/grid/console
e.g -> (http://192.168.0.100:4444/grid/console)
to check configuration
• Setup for Node
*Make sure java is install in Node machine
Download Selenium Server (Grid) jar
Link -> https://www.selenium.dev/downloads/
Open cmd and register it as Node for Hub
Command -> C:\Selenium>java -Dwebdriver.chrome.driver="C:\Selenium\chromedriver.exe" -jar selenium-server-standalone-3.141.59.jar -role webdriver -hub http://192.168.0.100:4444/grid/register -port 5566
(path>java -dwebdriver.chrome.driver="chromedriverpath" -jar jarfilename.jar -role rolename -hub hubipaddress -port portno)
• Code Setup
DesiredCapabilities dc = DesiredCapabilities.chrome(); //Use DesiredCapabilities to set property.
dc.setBrowserName("chrome"); //Set browser name
dc.setPlatform(Platform.WINDOWS); //Set platform name
WebDriver driver = new RemoteWebDriver(new URL("http://192.168.0.100:4444/wd/hub"),dc);
driver.get("https://www.google.com");
------------Framework------------
Selenium Framework is a code structure that helps to make code maintenance easy.
Without frameworks, we will place the “code” as well as “data” in the same place which is neither re-usable nor readable.
Using Frameworks, produce beneficial outcomes like increased code re-usage, higher portability, reduced script maintenance cost, higher code readability, etc.
• TestNG
Importance of TestNG
Run multiple test cases
The order of execution of different tests. User can put all the tests together in one testng.xml file
or can create separate testng.xml files for different based on the requirement.
• Maven - Build Management Tool
Apache Maven is a software project management and build management tool for Java Frameworks.
Why Maven?
Central repository to get dependencies
Maintaining common structure across the organization
Flexibility in Integrating with CI tools
Plugins for Test framework execution
• Ant - Build Management Tool
Apache Ant is a software project management and build management tool for Java Frameworks.
Why Ant?
Ant creates the application life cycle i.e. clean, compile, set dependency, execute, report, etc.
Third party API dependency can be set by Ant i.e. other Jar file's class path is set by Ant build file.
A complete application is created for End to End delivery and deployment.
It is a simple build tool where all configurations can be done using XML file and which can be executed from the command line.
It makes your code clean as configuration is separate from actual application logic.
• Data Driven
Drive the Global Environmental values from external files i.e (data.properties) to test file in java i.e (Test.java).
Properties
Excel
• Extent Report
Extent Report used to create report for test cases.
ExtentSparkReporter & ExtentReports are most important class in Extent Report
ExtentSparkReporter : Used to customize the report file
ExtentReports : Used to create report file
• Log4j
Log4j is a fast, flexible and reliable logging framework (APIS) written in Java.
Why Log4j
It is an open source.
With Log4j, it is possible to store the flow details of our Selenium Automation in a file or database.
Log4j is used for large as well as small projects
• Jenkins - Continues Integration Tool (CI)
Importance of Jenkins
Most important tool
Continues integration tool for automation
• PageObjectModel
Page Object Model is a design pattern, popularly used in test automation
that creates Object Repository for web UI elements.
The advantage of the model is that it reduces code duplication and improves test maintenance.
With Page Factory Without Page Factory
By() @FindBy()
No package import needed import package : PageFactory
• Cucumber - Behavior Driven Development (BDD)
It explains the behavior of the application in a simple English text using Gherkin language.
Feature file (.feature) [Scenario, Given, When, Then, And]
Step Definition file (.java) [Methods]
Test Runner file (.java) [CucumberOptions (features, glue)]
• Xslt
------------Database------------
Selenium Webdriver is limited to Testing your applications using Browser.
To use Selenium Webdriver for Database Verification you need to use the JDBC ("Java Database Connectivity").
JDBC (Java Database Connectivity) is a SQL level API that allows you to execute SQL statements.
It is responsible for the connectivity between the Java Programming language and a wide range of databases.
------------EndToEnd------------
EndToEndProject
• EndToEnd + Ant
• EndToEnd + Cucumber
• EndToEnd + Maven
------------Sauce Labs------------
Sauce Labs allows users to run their test cases in the cloud for different browsers, operating systems and device combinations.
• Imp Links :
https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/
https://wiki.saucelabs.com/display/DOCS/Getting+Started+with+Selenium+for+Automated+Website+Testing
------------AutoIt------------
AutoIt is a freeware scripting language designed for automating windows GUI and general scripting.
It uses a combination of mouse movement, keystrokes and window control manipulation to automate a task which is not possible by selenium webdriver.
• Imp Links :
https://www.autoitscript.com/site/autoit/downloads/