I am new to automation testing and I am trying to automate an app developed in my company.I have done all the setup (as per the online instructions) and have written a java code to test if I am able to launch my app through Appium in Android Emulator. All I am trying is to just to launch for now.
Steps I did:
- Started Appium
Run the below written code in Eclipse as TestNG
import org.junit.Before; import java.net.URL; import java.util.concurrent.TimeUnit; import java.net.MalformedURLException; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.RemoteWebDriver; public class Lauchandlogin { WebDriver driver; @Before public void setUp() throws MalformedURLException{ DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("avd", "NexS1"); capabilities.setCapability(CapabilityType.VERSION,"7.1.1"); capabilities.setCapability("deviceName","Android Emulator"); capabilities.setCapability("platformName","Andriod"); capabilities.setCapability("newCommandTimeout", 1200); capabilities.setCapability("appPackage","com.rhb.mobile"); capabilities.setCapability("appActivity","com.rhb.LandingActivity"); capabilities.setCapability("appWaitDuration",300000); driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723" ,capabilities); } }
The TestNG runs and I get the following message in Console Default test
Tests run: 0, Failures: 0, Skips: 0
Also a message on the top bar: LauchandLogin[TestNg]C:\Program Files\Java\jre1.8.101\bin\javaw.exe.
There is no reaction on Appium, which I think is because of my TestNG is not running at all??? I dont know. I am lost. Please help.
@Beforeis not considered as test it is a preparation step. If you want reported tests you have to annotate some methods with@Test. - Balázs Nemes