We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to run a Java test and create a extentreport using Listener class, base class and test class.
BaseTest.class
package qatarlivestock.pagefactory.utils;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URL;
import java.time.Duration;
import java.util.Properties;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.options.UiAutomator2Options;
import io.appium.java_client.service.local.AppiumDriverLocalService;
public class BaseTest {
public AndroidDriver driver; public AppiumDriverLocalService service; @BeforeClass public void configAppium() throws IOException{ Properties prop = new Properties(); FileInputStream fis = new FileInputStream(System.getProperty("user.dir")+"//src//main//java//qatarlivestock//testdata//data.properties"); prop.load(fis); String ipAddress = prop.getProperty("ipAddress"); String deviceName = prop.getProperty("deviceName"); UiAutomator2Options options = new UiAutomator2Options(); options.setDeviceName(deviceName); options.setApp(System.getProperty("user.dir")+"//src//test//java//qatarlivestock//testresources//app-qa-release_Sep11.apk"); driver = new AndroidDriver(new URL(ipAddress), options); driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
}
@AfterClass public void tearDown() { driver.quit(); }
Listeners.class
ExtentreporterNG.class
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.reporter.ExtentSparkReporter;
public class ExtentReporterNG {
static ExtentReports extent; public static ExtentReports getReporterObject() { String path = System.getProperty("user.dir")+"//testreports//result.html"; ExtentSparkReporter reporter=new ExtentSparkReporter(path); reporter.config().setReportName("Android Test Automation Result"); reporter.config().setDocumentTitle("Test Results"); extent = new ExtentReports(); extent.attachReporter(reporter); extent.setSystemInfo("Tester", "Reshma"); return extent; }
SuccessfullLoginTest.class
package qatarlivestock.testcases;
import org.testng.annotations.Test;
import qatarlivestock.pagefactory.android.SuccessfullLoginElements;
import qatarlivestock.pagefactory.utils.BaseTest;
public class SuccessfullLoginTest extends BaseTest{
@Test public void successfullLoginValidation() throws InterruptedException { SuccessfullLoginElements login = new SuccessfullLoginElements(driver); login.clickloginbtn(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying to run a Java test and create a extentreport using Listener class, base class and test class.
BaseTest.class
package qatarlivestock.pagefactory.utils;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URL;
import java.time.Duration;
import java.util.Properties;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.options.UiAutomator2Options;
import io.appium.java_client.service.local.AppiumDriverLocalService;
public class BaseTest {
}
}
Listeners.class
package qatarlivestock.pagefactory.utils;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URL;
import java.time.Duration;
import java.util.Properties;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.options.UiAutomator2Options;
import io.appium.java_client.service.local.AppiumDriverLocalService;
public class BaseTest {
}
}
ExtentreporterNG.class
package qatarlivestock.pagefactory.utils;
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.reporter.ExtentSparkReporter;
public class ExtentReporterNG {
}
SuccessfullLoginTest.class
package qatarlivestock.testcases;
import org.testng.annotations.Test;
import qatarlivestock.pagefactory.android.SuccessfullLoginElements;
import qatarlivestock.pagefactory.utils.BaseTest;
public class SuccessfullLoginTest extends BaseTest{
}
The text was updated successfully, but these errors were encountered: