Second commit
This commit is contained in:
parent
b4bf3e08ad
commit
961b82bb86
207
pom.xml
207
pom.xml
|
@ -1,20 +1,22 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>DCIM_Counts_Check</groupId>
|
||||
<artifactId>DCIM_Counts_Check</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
|
||||
<name>DCIM_Counts_Check</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>DCIM_Counts_Check</groupId>
|
||||
<artifactId>DCIM_Counts_Check</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
|
||||
<name>DCIM_Counts_Check</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<junit.jupiter.version>5.6.0</junit.jupiter.version>
|
||||
<maven.compiler.release>11</maven.compiler.release>
|
||||
<project.build.testSourceDirectory>src/test/java</project.build.testSourceDirectory>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<junit.jupiter.version>5.6.0</junit.jupiter.version>
|
||||
<maven.compiler.release>11</maven.compiler.release>
|
||||
<project.build.testSourceDirectory>src/test/java</project.build.testSourceDirectory>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
|
@ -25,32 +27,26 @@
|
|||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<!-- Other dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.github.bonigarcia</groupId>
|
||||
<artifactId>webdrivermanager</artifactId>
|
||||
<version>5.5.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.cucumber</groupId>
|
||||
<artifactId>gherkin</artifactId>
|
||||
<version>5.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.cucumber</groupId>
|
||||
<artifactId>gherkin</artifactId>
|
||||
<version>5.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
|
||||
<dependency>
|
||||
|
@ -59,25 +55,26 @@
|
|||
<version>1.5.5</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.github.bonigarcia</groupId>
|
||||
<artifactId>webdrivermanager</artifactId>
|
||||
<version>5.5.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.github.bonigarcia</groupId>
|
||||
<artifactId>webdrivermanager</artifactId>
|
||||
<version>5.5.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
<artifactId>javax.mail</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.github.ralfstuckert.pdfbox-layout/pdfbox2-layout -->
|
||||
<!--
|
||||
https://mvnrepository.com/artifact/com.github.ralfstuckert.pdfbox-layout/pdfbox2-layout -->
|
||||
<dependency>
|
||||
<groupId>com.github.ralfstuckert.pdfbox-layout</groupId>
|
||||
<artifactId>pdfbox2-layout</artifactId>
|
||||
|
@ -85,7 +82,6 @@
|
|||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
|
||||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
|
@ -116,25 +112,26 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-picocontainer -->
|
||||
<dependency>
|
||||
<groupId>io.cucumber</groupId>
|
||||
<artifactId>cucumber-picocontainer</artifactId>
|
||||
<version>4.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!--
|
||||
https://mvnrepository.com/artifact/io.cucumber/cucumber-picocontainer -->
|
||||
<dependency>
|
||||
<groupId>io.cucumber</groupId>
|
||||
<artifactId>cucumber-picocontainer</artifactId>
|
||||
<version>4.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->
|
||||
<dependency>
|
||||
<groupId>io.cucumber</groupId>
|
||||
<artifactId>cucumber-core</artifactId>
|
||||
<version>4.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->
|
||||
<dependency>
|
||||
<groupId>io.cucumber</groupId>
|
||||
<artifactId>cucumber-core</artifactId>
|
||||
<version>4.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
|
||||
<!--
|
||||
https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
|
||||
<dependency>
|
||||
<groupId>org.seleniumhq.selenium</groupId>
|
||||
<artifactId>selenium-java</artifactId>
|
||||
|
@ -142,7 +139,8 @@
|
|||
</dependency>
|
||||
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports-cucumber4-adapter -->
|
||||
<!--
|
||||
https://mvnrepository.com/artifact/com.aventstack/extentreports-cucumber4-adapter -->
|
||||
<dependency>
|
||||
<groupId>com.aventstack</groupId>
|
||||
<artifactId>extentreports-cucumber4-adapter</artifactId>
|
||||
|
@ -167,47 +165,48 @@
|
|||
<version>2.3.30</version>
|
||||
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.maven/maven-plugin-api -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>3.8.3</version>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
https://mvnrepository.com/artifact/org.apache.maven/maven-plugin-api -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>3.8.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<verbose>true</verbose>
|
||||
<fork>true</fork>
|
||||
<executable>C:\Program Files\Java\jdk1.8.0_202\bin\javac</executable>
|
||||
<compilerVersion>1.3</compilerVersion>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.18.1</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit47</artifactId>
|
||||
<version>2.18.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<inherited>true</inherited>
|
||||
<configuration>
|
||||
<suiteXmlFiles>
|
||||
<suiteXmlFile>/home/aissel/git2/DCIM_Counts_Check/testng.xml</suiteXmlFile>
|
||||
</suiteXmlFiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<verbose>true</verbose>
|
||||
<fork>true</fork>
|
||||
<executable>C:\Program Files\Java\jdk1.8.0_202\bin\javac</executable>
|
||||
<compilerVersion>1.3</compilerVersion>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.18.1</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>surefire-junit47</artifactId>
|
||||
<version>2.18.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<inherited>true</inherited>
|
||||
<configuration>
|
||||
<suiteXmlFiles>
|
||||
<suiteXmlFile>/home/aissel/git4/testng.xml</suiteXmlFile>
|
||||
</suiteXmlFiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -5,11 +5,14 @@ import java.util.concurrent.TimeUnit;
|
|||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import Utilities.ConfigReader;
|
||||
import io.github.bonigarcia.wdm.WebDriverManager;
|
||||
|
||||
public class Contacts_Count
|
||||
{
|
||||
@Test
|
||||
public static void main(String[] args) throws InterruptedException
|
||||
{
|
||||
WebDriverManager.chromedriver().setup();
|
||||
|
@ -40,7 +43,7 @@ public class Contacts_Count
|
|||
System.out.println("Contacts: " + text);
|
||||
Thread.sleep(3000);
|
||||
driver.findElement(By.xpath("//p[@id='settings_menu ']")).click();
|
||||
driver.findElement(By.xpath("//body[1]/div[74]/div[2]/div[1]/div[1]/a[1]/div[1]/table[1]/tbody[1]/tr[1]/td[2]/a[1]")).click();
|
||||
driver.findElement(By.xpath("//a[@onclick='logoutOtherURLS()']")).click();
|
||||
Thread.sleep(3000);
|
||||
}
|
||||
driver.quit();
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.openqa.selenium.WebElement;
|
|||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
import org.testng.annotations.Test;
|
||||
import org.testng.internal.BaseClassFinder;
|
||||
|
||||
import Utilities.ConfigReader;
|
||||
|
@ -17,16 +18,15 @@ import io.github.bonigarcia.wdm.WebDriverManager;
|
|||
|
||||
public class Discover_Count
|
||||
{
|
||||
String path = System.getProperty("user.dir");
|
||||
|
||||
@Test
|
||||
public static void main(String[] args) throws InterruptedException
|
||||
{
|
||||
WebDriverManager.chromedriver().setup();
|
||||
WebDriver driver = new ChromeDriver();
|
||||
ConfigReader config = new ConfigReader();
|
||||
ConfigReader config = new ConfigReader();
|
||||
// Define the sets you want to use
|
||||
//String[] sets = {"set1", "set2", "set3", "set4", "set5", "set6", "set7"};
|
||||
String[] sets = {"set1", "set4", "set5", "set6", "set7"};
|
||||
String[] sets = {"set1", "set2", "set4", "set5", "set6", "set7"};
|
||||
//String[] sets = {"set1", "set4", "set5", "set6", "set7"};
|
||||
Thread.sleep(10000);
|
||||
for (String set : sets) {
|
||||
Thread.sleep(10000);
|
||||
|
@ -46,12 +46,23 @@ public class Discover_Count
|
|||
Thread.sleep(5000);
|
||||
WebDriverWait wait = new WebDriverWait(driver, 60);
|
||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[normalize-space()='Reset']")));
|
||||
//wait.until(ExpectedConditions.titleContains("kolsByRankingPager_left"));
|
||||
//JavascriptExecutor jse = (JavascriptExecutor) driver;
|
||||
//jse.executeScript("window.scrollTo(0,document.body.scrollHeight)");
|
||||
|
||||
String text= driver.findElement(By.xpath("//div[@class='ui-paging-info']")).getText();
|
||||
System.out.println("Total Discover count: " + text);
|
||||
Thread.sleep(3000);
|
||||
driver.findElement(By.xpath("//p[@id='settings_menu ']")).click();
|
||||
driver.findElement(By.xpath("//a[@onclick='logoutOtherURLS()']")).click();
|
||||
Thread.sleep(3000);
|
||||
}
|
||||
driver.quit();
|
||||
|
||||
//driver.findElement(By.xpath("//span[@class='ui-icon ui-icon-seek-end']")).click();
|
||||
try {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* try {
|
||||
int totalRowCount = 0;
|
||||
boolean hasNextPage = true;
|
||||
|
||||
|
@ -92,6 +103,6 @@ public class Discover_Count
|
|||
driver.quit();
|
||||
}
|
||||
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.openqa.selenium.chrome.ChromeDriver;
|
|||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.Wait;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
import org.testng.annotations.Test;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
@ -19,9 +20,10 @@ import org.openqa.selenium.support.ui.ExpectedConditions;
|
|||
import Utilities.ConfigReader;
|
||||
import Utilities.readConfigFile;
|
||||
import io.github.bonigarcia.wdm.WebDriverManager;
|
||||
|
||||
|
||||
public class Track_Interaction_Count
|
||||
{
|
||||
@Test
|
||||
public static void main(String[] args) throws InterruptedException
|
||||
{
|
||||
WebDriverManager.chromedriver().setup();
|
||||
|
@ -29,7 +31,7 @@ public class Track_Interaction_Count
|
|||
ConfigReader config = new ConfigReader();
|
||||
// Define the sets you want to use
|
||||
String[] sets = {"set1", "set2", "set3", "set4", "set5", "set6", "set7"};
|
||||
|
||||
|
||||
Thread.sleep(10000);
|
||||
for (String set : sets) {
|
||||
Thread.sleep(10000);
|
||||
|
@ -52,11 +54,34 @@ public class Track_Interaction_Count
|
|||
|
||||
driver.findElement(By.xpath("//div[@id='resetBttn']")).click();
|
||||
Thread.sleep(3000);
|
||||
WebDriverWait wait = new WebDriverWait(driver, 10);
|
||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='wrapper']")));
|
||||
|
||||
WebDriverWait wait = new WebDriverWait(driver, 10);
|
||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='wrapper']")));
|
||||
|
||||
try {
|
||||
String text= driver.findElement(By.xpath("//div[@class='ui-paging-info']")).getText();
|
||||
System.out.println("Total Interactions count: " + text);
|
||||
Thread.sleep(3000);
|
||||
|
||||
} catch (NoSuchElementException e) {
|
||||
// Handle the exception here (e.g., log, report, or take screenshots)
|
||||
System.out.println("Element not found: " + e.getMessage());
|
||||
}
|
||||
|
||||
driver.findElement(By.xpath("//p[@id='settings_menu ']")).click();
|
||||
driver.findElement(By.xpath("//a[@onclick='logoutOtherURLS()']")).click();
|
||||
Thread.sleep(3000);
|
||||
|
||||
}
|
||||
driver.quit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*try {
|
||||
int totalRowCount = 0;
|
||||
boolean hasNextPage = true;
|
||||
|
||||
|
@ -91,7 +116,7 @@ public class Track_Interaction_Count
|
|||
// Handle the exception here (e.g., log, report, or take screenshots)
|
||||
System.out.println("Element not found: " + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
driver.findElement(By.xpath("//p[@id='settings_menu ']")).click();
|
||||
driver.findElement(By.xpath("//a[@onclick='logoutOtherURLS()']")).click();
|
||||
Thread.sleep(3000);
|
||||
|
@ -99,5 +124,5 @@ public class Track_Interaction_Count
|
|||
}
|
||||
driver.quit();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
|
|
@ -11,20 +11,22 @@ import org.openqa.selenium.chrome.ChromeDriver;
|
|||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import Utilities.ConfigReader;
|
||||
import Utilities.readConfigFile;
|
||||
import io.github.bonigarcia.wdm.WebDriverManager;
|
||||
|
||||
|
||||
public class Track_Interaction_Export
|
||||
{
|
||||
@Test
|
||||
public static void main(String[] args) throws InterruptedException
|
||||
{
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
// Set the download directory
|
||||
options.addArguments("download.default_directory=/home/aissel/git4");
|
||||
options.addArguments("download.default_directory=" +System.getProperty("user.dir"));
|
||||
// Disable the download prompt
|
||||
options.setExperimentalOption("prefs",
|
||||
ImmutableMap.of("download.prompt_for_download", false, "download.directory_upgrade", true));
|
||||
|
@ -64,7 +66,8 @@ public class Track_Interaction_Export
|
|||
WebDriverWait wait = new WebDriverWait(driver, 30);
|
||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//a[@data-original-title='Export Interaction Detail into Excel format']")));
|
||||
|
||||
File downloadedFile = new File("/home/aissel/Git2/DICM_Count/exported_file.xlsx");
|
||||
//File downloadedFile = new File("/home/aissel/git4/exported_file.xlsx");
|
||||
File downloadedFile = new File(System.getProperty("user.dir")+"/exported_file.xlsx");
|
||||
if (downloadedFile.exists()) {
|
||||
System.out.println("Downloaded file exists.");
|
||||
} else {
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.openqa.selenium.chrome.ChromeDriver;
|
|||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
|
@ -20,12 +21,14 @@ import io.github.bonigarcia.wdm.WebDriverManager;
|
|||
|
||||
public class Track_Medinsght_Export
|
||||
{
|
||||
@Test
|
||||
public static void main(String[] args) throws InterruptedException
|
||||
{
|
||||
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
// Set the download directory
|
||||
options.addArguments("download.default_directory=/home/aissel/git4");
|
||||
//options.addArguments("download.default_directory=/home/aissel/git4");
|
||||
options.addArguments("download.default_directory=" +System.getProperty("user.dir"));
|
||||
// Disable the download prompt
|
||||
options.setExperimentalOption("prefs",
|
||||
ImmutableMap.of("download.prompt_for_download", false, "download.directory_upgrade", true));
|
||||
|
@ -66,7 +69,7 @@ public class Track_Medinsght_Export
|
|||
WebDriverWait wait = new WebDriverWait(driver, 30);
|
||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@class='excelExportIcon sprite_iconSet tooltip-demo tooltop-left']")));
|
||||
|
||||
File downloadedFile = new File("/home/aissel/Git2/DICM_Count/exported_file.xlsx");
|
||||
File downloadedFile = new File(System.getProperty("user.dir")+"/exported_file.xlsx");
|
||||
if (downloadedFile.exists()) {
|
||||
System.out.println("Downloaded file exists.");
|
||||
} else {
|
||||
|
|
|
@ -10,20 +10,22 @@ import org.openqa.selenium.WebElement;
|
|||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import Utilities.ConfigReader;
|
||||
import Utilities.readConfigFile;
|
||||
import io.github.bonigarcia.wdm.WebDriverManager;
|
||||
|
||||
|
||||
public class Track_Medinsight_Count
|
||||
{
|
||||
@Test
|
||||
public static void main(String[] args) throws InterruptedException
|
||||
{
|
||||
WebDriverManager.chromedriver().setup();
|
||||
WebDriver driver = new ChromeDriver();
|
||||
ConfigReader config = new ConfigReader();
|
||||
// Define the sets you want to use
|
||||
String[] sets = {"set1", "set2", "set3", "set4", "set5", "set6"};
|
||||
String[] sets = {"set1", "set2", "set3", "set4", "set5", "set6", "set7"};
|
||||
//String[] sets = {"set"};
|
||||
Thread.sleep(10000);
|
||||
for (String set : sets) {
|
||||
|
@ -44,14 +46,34 @@ public class Track_Medinsight_Count
|
|||
element.click();
|
||||
Thread.sleep(3000);
|
||||
//driver.findElement(By.xpath("//div[@class='navLinkTrack sprite_iconSet ']")).click();
|
||||
driver.findElement(By.xpath("//label[@for='medical_insight']")).click();
|
||||
driver.findElement(By.xpath("//div[@id='resetBttn']")).click();
|
||||
driver.findElement(By.xpath("//label[@for='medical_insight']")).click();
|
||||
driver.findElement(By.xpath("//div[@id='resetBttn']")).click();
|
||||
Thread.sleep(3000);
|
||||
WebDriverWait wait = new WebDriverWait(driver, 10);
|
||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='wrapper']")));
|
||||
|
||||
WebDriverWait wait = new WebDriverWait(driver, 10);
|
||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='wrapper']")));
|
||||
|
||||
try {
|
||||
String text= driver.findElement(By.xpath("//div[@class='ui-paging-info']")).getText();
|
||||
System.out.println("Total MedInsight count: " + text);
|
||||
Thread.sleep(3000);
|
||||
|
||||
} catch (NoSuchElementException e) {
|
||||
// Handle the exception here (e.g., log, report, or take screenshots)
|
||||
System.out.println("Element not found: " + e.getMessage());
|
||||
}
|
||||
|
||||
driver.findElement(By.xpath("//p[@id='settings_menu ']")).click();
|
||||
driver.findElement(By.xpath("//a[@onclick='logoutOtherURLS()']")).click();
|
||||
Thread.sleep(3000);
|
||||
|
||||
}
|
||||
driver.quit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*try {
|
||||
int totalRowCount = 0;
|
||||
boolean hasNextPage = true;
|
||||
|
||||
|
@ -86,7 +108,7 @@ public class Track_Medinsight_Count
|
|||
// Handle the exception here (e.g., log, report, or take screenshots)
|
||||
System.out.println("Element not found: " + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
driver.findElement(By.xpath("//p[@id='settings_menu ']")).click();
|
||||
driver.findElement(By.xpath("//a[@onclick='logoutOtherURLS()']")).click();
|
||||
Thread.sleep(3000);
|
||||
|
@ -94,10 +116,10 @@ public class Track_Medinsight_Count
|
|||
}
|
||||
driver.quit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,26 +4,26 @@ import java.io.IOException;
|
|||
import java.util.Properties;
|
||||
public class ConfigReader
|
||||
{
|
||||
private Properties properties;
|
||||
private Properties properties;
|
||||
|
||||
public ConfigReader() {
|
||||
properties = new Properties();
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream("/home/aissel/git4/src/test/resources/browser-config.properties");
|
||||
properties.load(fis);
|
||||
fis.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public ConfigReader() {
|
||||
properties = new Properties();
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(System.getProperty("user.dir")+"/src/test/resources/browser-config.properties");
|
||||
properties.load(fis);
|
||||
fis.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public String getProperty(String setName, String key) {
|
||||
// Combine the set name and key to get the property
|
||||
return properties.getProperty(setName + "." + key);
|
||||
}
|
||||
public String getProperty(String setName, String key) {
|
||||
// Combine the set name and key to get the property
|
||||
return properties.getProperty(setName + "." + key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<suite name="Suite">
|
||||
<test thread-count="5" name="Test" junit="true">
|
||||
<classes>
|
||||
<class name="StepDefinitions.testRunnerTest"/>
|
||||
<class name="test.Contacts_Count"/>
|
||||
</classes>
|
||||
</test> <!-- Test -->
|
||||
</suite> <!-- Suite -->
|
||||
|
|
Loading…
Reference in New Issue