How can create a single test using appium and selnium to run an interactive communication between mobile apk and desktop web

I have a sequence of one test:

  • open application in android device
  • do some click (like sending mail)
  • in Desktop , open browser > open the URL and check that the mail is correctly received
    Currently, I’m obliged to spilt my test two seperated tests:
  • first one : test mobile android apk
  • test two: selenium test

Thanks for your help

send email to any email service with API and check email using it. example with gmail -> https://developers.google.com/gmail/api/v1/reference/users/messages/list#try-it

You can keep your tests separate and create a test dependency by using TestNG’s @Test(dependsOnMethods) annotation.

Thanks Aleksei,
but sending email is just an exemple to describe what I need.

Thanks Cesarv,

There is a good idea to use this annotation @test(dependsOnMethods), but my design is like:

  • packageMobile

    • class: testMobileOne (appium)
  • packageWeb

    • class: testWebOne (selenium)

and the “despondsOnMethods” annotation can be used for depdendencies between class testMobileOne and class TestWebOne ??

Then just add second driver variable in your tests. And use it for web.

E.g. i had projects with 3 drivers where 2 drivers are mobile phones that test between each other like chat and third is webdriver. Last one i used to check something in admin console or something other while api was closed for me.

Thank you Aleskei, I will try your example.

@Anism,

No, this annotation property can be used only for methods within the same class. In your case, use dependsOnGroups instead. For example, given this class:

import org.testng.annotations.Test;

public class Test1 {
    @Test(groups = { "test1" })
    public void test1() {
        assert true;
    }
}

And this class:

import org.testng.annotations.Test;

public class Test2 {
    @Test(groups = { "test2" }, dependsOnGroups = { "test1" })
    public void test2() {
        assert true;
    }
}

Running the following testng.xml file will make test2() pass only if test1() is included in the suite as well. Otherwise, test2 will be ignored.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="all tests">
    <test name="dependency example">
    <groups>
        <run>
            <include name="test1"/>
            <include name="test2"/>
        </run>
    </groups>
    </test>
</suite>

You can also create the dependencies in the XML file, as detailed here:

https://testng.org/doc/documentation-main.html#dependencies-in-xml

Thank you @cesarv for your reply