Skip to content

Commit 7af3348

Browse files
initial commit
1 parent cd12e77 commit 7af3348

File tree

7 files changed

+227
-2
lines changed

7 files changed

+227
-2
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/uiDesigner.xml

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,26 @@
88
<artifactId>selenium-java-test</artifactId>
99
<version>1.0-SNAPSHOT</version>
1010

11+
<dependencies>
12+
<dependency>
13+
<groupId>org.seleniumhq.selenium</groupId>
14+
<artifactId>selenium-java</artifactId>
15+
<version>4.17.0</version>
16+
</dependency>
17+
18+
<dependency>
19+
<groupId>org.seleniumhq.selenium</groupId>
20+
<artifactId>selenium-server</artifactId>
21+
<version>3.141.59</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>junit</groupId>
25+
<artifactId>junit</artifactId>
26+
<version>RELEASE</version>
27+
<scope>compile</scope>
28+
</dependency>
29+
</dependencies>
30+
1131
<properties>
1232
<maven.compiler.source>17</maven.compiler.source>
1333
<maven.compiler.target>17</maven.compiler.target>
Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,53 @@
11
package org.testing;
22

3+
import org.junit.Test;
4+
import org.openqa.selenium.Platform;
5+
import org.openqa.selenium.WebDriver;
6+
import org.openqa.selenium.remote.DesiredCapabilities;
7+
import org.openqa.selenium.remote.RemoteWebDriver;
8+
9+
import java.net.MalformedURLException;
10+
import java.net.URL;
11+
12+
/**
13+
* Web page testing class.
14+
*
15+
* @version 1.0.0
16+
* @autor StasTkachenko3
17+
*/
318
public class Test1 {
4-
public static void main(String[] args) {
5-
System.out.println("Hello world!");
19+
20+
/*
21+
______ __
22+
/ ____/__ / /__ ____ (_)_ ______ ___
23+
\__ \/ _ \/ / _ \/ __ \/ / / / / __ `__ \
24+
___/ / __/ / __/ / / / / /_/ / / / / / /
25+
/____/\___/_/\___/_/ /_/_/\__,_/_/ /_/ /_/
26+
------------------------------------------
27+
28+
*/
29+
30+
/**
31+
* The method opens the page and checks its title in the browser.
32+
*
33+
* @throws MalformedURLException
34+
*/
35+
@Test
36+
public void test1() throws MalformedURLException {
37+
38+
DesiredCapabilities capability = new DesiredCapabilities();
39+
capability.setBrowserName("chrome");
40+
capability.setPlatform(Platform.WIN10);
41+
// Create a new driver instance.
42+
WebDriver driver;
43+
driver = new RemoteWebDriver(new URL("http://192.168.99.1:4444/wd/hub"), capability);
44+
driver.manage().window().maximize();
45+
// Opening a page in the browser.
46+
driver.get("https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley");
47+
// Check the page title.
48+
System.out.println("Title of the page is " + driver.getTitle());
49+
// After the test you need to close the browser.
50+
driver.quit();
51+
652
}
753
}

0 commit comments

Comments
 (0)