Web Service

Learn how to use BELLATRIX android web service.

Example

@ExecutionApp(isMobileWebTest = true)
public class TouchActionsServiceTests extends AndroidTest {
    @Test
    public void htmlSourceContainsShop_When_OpenWebPageWithChrome() {
        app().web().navigate().to("http://demos.bellatrix.solutions/");
        Assert.assertTrue(app().web().browser().getPageSource().contains("Shop"));
    }
}

Explanations

@ExecutionApp(isMobileWebTest = true)
public class TouchActionsServiceTests extends AndroidTest

To test web apps, you can start Chrome browser by setting the ExecutionApp annotation’s isMobileWebTest property to true.

app().web().navigate().to("http://demos.bellatrix.solutions/");

Opens Chrome browser and navigates to the mentioned page.

Assert.assertTrue(app().web().browser().getPageSource().contains("Shop"));

Through the web method you can access almost all BELLATRIX Web APIs.