Skip to main content

Web Test

The WebTest.java file is an example test class that demonstrates how to create a basic web test using Selcukes. It includes a test method called remoteWebTest() that opens the Google homepage and asserts that the page title is "Google".

The test class also includes a setup() method annotated with @BeforeMethod, which is executed before each test method. The setup() method initializes the WebPage object from the Pages utility class.

package org.example;

import io.github.selcukes.commons.annotation.Lifecycle;
import io.github.selcukes.core.page.Pages;
import io.github.selcukes.core.page.WebPage;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

@Lifecycle
public class WebTest {
WebPage page;

@BeforeMethod
public void setup() {
page = Pages.webPage();
}

@Test
public void sampleWebTest() {
page.open("https://www.google.com/")
.assertThat().title("Google");
}

}

Subscribe for product updates

By subscribing, you agree with Selcukes’s Terms of Service and Privacy Policy.