WebService

Learn how to use BELLATRIX Android WebService.

Example

[TestFixture]
[AndroidWeb(Constants.AndroidNativeAppPath,
    Constants.AndroidDefaultAndroidVersion,
    Constants.AndroidDefaultDeviceName,
    Lifecycle.RestartEveryTime)]
public class WebServiceTests : AndroidTest
{
    [Test]
    public void HtmlSourceContainsShop_When_OpenWebPageWithChrome()
    {
        App.Web.NavigationService.Navigate("http://demos.bellatrix.solutions/");
        Assert.IsTrue(App.Web.BrowserService.HtmlSource.Contains("Shop"));
    }
}

Explanations

BELLATRIX gives you an interface for easier work with web apps. Using it, you can access most of the features of BELLATRIX web APIs.

[TestFixture]
[AndroidWeb(Constants.AndroidNativeAppPath,
    Constants.AndroidDefaultAndroidVersion,
    Constants.AndroidDefaultDeviceName,
    Lifecycle.RestartEveryTime)]
public class WebServiceTests : AndroidTest

To test web apps, you can start Chrome browser using the AndroidWeb attribute.

App.Web.NavigationService.Navigate("http://demos.bellatrix.solutions/");

Opens Chrome browser and navigates to the mentioned page.

Assert.IsTrue(App.Web.BrowserService.HtmlSource.Contains("Shop"));

Through Web property you can access almost all BELLATRIX Web APIs.