Second commit
This commit is contained in:
parent
b4bf3e08ad
commit
961b82bb86
75
pom.xml
75
pom.xml
|
@ -1,4 +1,6 @@
|
||||||
<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">
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>DCIM_Counts_Check</groupId>
|
<groupId>DCIM_Counts_Check</groupId>
|
||||||
<artifactId>DCIM_Counts_Check</artifactId>
|
<artifactId>DCIM_Counts_Check</artifactId>
|
||||||
|
@ -25,32 +27,26 @@
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- Other dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.11</version>
|
<version>4.12</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.bonigarcia</groupId>
|
|
||||||
<artifactId>webdrivermanager</artifactId>
|
|
||||||
<version>5.5.3</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.cucumber</groupId>
|
<groupId>io.cucumber</groupId>
|
||||||
<artifactId>gherkin</artifactId>
|
<artifactId>gherkin</artifactId>
|
||||||
<version>5.1.0</version>
|
<version>5.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
|
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>3.9</version>
|
<version>3.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
|
<!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -59,25 +55,26 @@
|
||||||
<version>1.5.5</version>
|
<version>1.5.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
|
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>3.4</version>
|
<version>3.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.github.bonigarcia</groupId>
|
<groupId>io.github.bonigarcia</groupId>
|
||||||
<artifactId>webdrivermanager</artifactId>
|
<artifactId>webdrivermanager</artifactId>
|
||||||
<version>5.5.3</version>
|
<version>5.5.3</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sun.mail</groupId>
|
<groupId>com.sun.mail</groupId>
|
||||||
<artifactId>javax.mail</artifactId>
|
<artifactId>javax.mail</artifactId>
|
||||||
<version>1.6.2</version>
|
<version>1.6.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/com.github.ralfstuckert.pdfbox-layout/pdfbox2-layout -->
|
<!--
|
||||||
|
https://mvnrepository.com/artifact/com.github.ralfstuckert.pdfbox-layout/pdfbox2-layout -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.ralfstuckert.pdfbox-layout</groupId>
|
<groupId>com.github.ralfstuckert.pdfbox-layout</groupId>
|
||||||
<artifactId>pdfbox2-layout</artifactId>
|
<artifactId>pdfbox2-layout</artifactId>
|
||||||
|
@ -85,7 +82,6 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
|
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.testng</groupId>
|
<groupId>org.testng</groupId>
|
||||||
|
@ -116,25 +112,26 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-picocontainer -->
|
<!--
|
||||||
<dependency>
|
https://mvnrepository.com/artifact/io.cucumber/cucumber-picocontainer -->
|
||||||
|
<dependency>
|
||||||
<groupId>io.cucumber</groupId>
|
<groupId>io.cucumber</groupId>
|
||||||
<artifactId>cucumber-picocontainer</artifactId>
|
<artifactId>cucumber-picocontainer</artifactId>
|
||||||
<version>4.8.1</version>
|
<version>4.8.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->
|
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.cucumber</groupId>
|
<groupId>io.cucumber</groupId>
|
||||||
<artifactId>cucumber-core</artifactId>
|
<artifactId>cucumber-core</artifactId>
|
||||||
<version>4.8.1</version>
|
<version>4.8.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
|
https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.seleniumhq.selenium</groupId>
|
<groupId>org.seleniumhq.selenium</groupId>
|
||||||
<artifactId>selenium-java</artifactId>
|
<artifactId>selenium-java</artifactId>
|
||||||
|
@ -142,7 +139,8 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports-cucumber4-adapter -->
|
<!--
|
||||||
|
https://mvnrepository.com/artifact/com.aventstack/extentreports-cucumber4-adapter -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aventstack</groupId>
|
<groupId>com.aventstack</groupId>
|
||||||
<artifactId>extentreports-cucumber4-adapter</artifactId>
|
<artifactId>extentreports-cucumber4-adapter</artifactId>
|
||||||
|
@ -167,12 +165,13 @@
|
||||||
<version>2.3.30</version>
|
<version>2.3.30</version>
|
||||||
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.maven/maven-plugin-api -->
|
<!--
|
||||||
<dependency>
|
https://mvnrepository.com/artifact/org.apache.maven/maven-plugin-api -->
|
||||||
|
<dependency>
|
||||||
<groupId>org.apache.maven</groupId>
|
<groupId>org.apache.maven</groupId>
|
||||||
<artifactId>maven-plugin-api</artifactId>
|
<artifactId>maven-plugin-api</artifactId>
|
||||||
<version>3.8.3</version>
|
<version>3.8.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -201,13 +200,13 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<inherited>true</inherited>
|
<inherited>true</inherited>
|
||||||
<configuration>
|
<configuration>
|
||||||
<suiteXmlFiles>
|
<suiteXmlFiles>
|
||||||
<suiteXmlFile>/home/aissel/git2/DCIM_Counts_Check/testng.xml</suiteXmlFile>
|
<suiteXmlFile>/home/aissel/git4/testng.xml</suiteXmlFile>
|
||||||
</suiteXmlFiles>
|
</suiteXmlFiles>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
|
@ -5,11 +5,14 @@ import java.util.concurrent.TimeUnit;
|
||||||
import org.openqa.selenium.By;
|
import org.openqa.selenium.By;
|
||||||
import org.openqa.selenium.WebDriver;
|
import org.openqa.selenium.WebDriver;
|
||||||
import org.openqa.selenium.chrome.ChromeDriver;
|
import org.openqa.selenium.chrome.ChromeDriver;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import Utilities.ConfigReader;
|
import Utilities.ConfigReader;
|
||||||
import io.github.bonigarcia.wdm.WebDriverManager;
|
import io.github.bonigarcia.wdm.WebDriverManager;
|
||||||
|
|
||||||
public class Contacts_Count
|
public class Contacts_Count
|
||||||
{
|
{
|
||||||
|
@Test
|
||||||
public static void main(String[] args) throws InterruptedException
|
public static void main(String[] args) throws InterruptedException
|
||||||
{
|
{
|
||||||
WebDriverManager.chromedriver().setup();
|
WebDriverManager.chromedriver().setup();
|
||||||
|
@ -40,7 +43,7 @@ public class Contacts_Count
|
||||||
System.out.println("Contacts: " + text);
|
System.out.println("Contacts: " + text);
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
driver.findElement(By.xpath("//p[@id='settings_menu ']")).click();
|
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);
|
Thread.sleep(3000);
|
||||||
}
|
}
|
||||||
driver.quit();
|
driver.quit();
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.openqa.selenium.WebElement;
|
||||||
import org.openqa.selenium.chrome.ChromeDriver;
|
import org.openqa.selenium.chrome.ChromeDriver;
|
||||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
import org.testng.internal.BaseClassFinder;
|
import org.testng.internal.BaseClassFinder;
|
||||||
|
|
||||||
import Utilities.ConfigReader;
|
import Utilities.ConfigReader;
|
||||||
|
@ -17,16 +18,15 @@ import io.github.bonigarcia.wdm.WebDriverManager;
|
||||||
|
|
||||||
public class Discover_Count
|
public class Discover_Count
|
||||||
{
|
{
|
||||||
String path = System.getProperty("user.dir");
|
@Test
|
||||||
|
|
||||||
public static void main(String[] args) throws InterruptedException
|
public static void main(String[] args) throws InterruptedException
|
||||||
{
|
{
|
||||||
WebDriverManager.chromedriver().setup();
|
WebDriverManager.chromedriver().setup();
|
||||||
WebDriver driver = new ChromeDriver();
|
WebDriver driver = new ChromeDriver();
|
||||||
ConfigReader config = new ConfigReader();
|
ConfigReader config = new ConfigReader();
|
||||||
// Define the sets you want to use
|
// Define the sets you want to use
|
||||||
//String[] sets = {"set1", "set2", "set3", "set4", "set5", "set6", "set7"};
|
String[] sets = {"set1", "set2", "set4", "set5", "set6", "set7"};
|
||||||
String[] sets = {"set1", "set4", "set5", "set6", "set7"};
|
//String[] sets = {"set1", "set4", "set5", "set6", "set7"};
|
||||||
Thread.sleep(10000);
|
Thread.sleep(10000);
|
||||||
for (String set : sets) {
|
for (String set : sets) {
|
||||||
Thread.sleep(10000);
|
Thread.sleep(10000);
|
||||||
|
@ -46,12 +46,23 @@ public class Discover_Count
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
WebDriverWait wait = new WebDriverWait(driver, 60);
|
WebDriverWait wait = new WebDriverWait(driver, 60);
|
||||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[normalize-space()='Reset']")));
|
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)");
|
|
||||||
|
|
||||||
//driver.findElement(By.xpath("//span[@class='ui-icon ui-icon-seek-end']")).click();
|
String text= driver.findElement(By.xpath("//div[@class='ui-paging-info']")).getText();
|
||||||
try {
|
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();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* try {
|
||||||
int totalRowCount = 0;
|
int totalRowCount = 0;
|
||||||
boolean hasNextPage = true;
|
boolean hasNextPage = true;
|
||||||
|
|
||||||
|
@ -92,6 +103,6 @@ public class Discover_Count
|
||||||
driver.quit();
|
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.ExpectedConditions;
|
||||||
import org.openqa.selenium.support.ui.Wait;
|
import org.openqa.selenium.support.ui.Wait;
|
||||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
import org.openqa.selenium.By;
|
import org.openqa.selenium.By;
|
||||||
import org.openqa.selenium.WebDriver;
|
import org.openqa.selenium.WebDriver;
|
||||||
import org.openqa.selenium.WebElement;
|
import org.openqa.selenium.WebElement;
|
||||||
|
@ -22,6 +23,7 @@ import io.github.bonigarcia.wdm.WebDriverManager;
|
||||||
|
|
||||||
public class Track_Interaction_Count
|
public class Track_Interaction_Count
|
||||||
{
|
{
|
||||||
|
@Test
|
||||||
public static void main(String[] args) throws InterruptedException
|
public static void main(String[] args) throws InterruptedException
|
||||||
{
|
{
|
||||||
WebDriverManager.chromedriver().setup();
|
WebDriverManager.chromedriver().setup();
|
||||||
|
@ -55,8 +57,31 @@ public class Track_Interaction_Count
|
||||||
WebDriverWait wait = new WebDriverWait(driver, 10);
|
WebDriverWait wait = new WebDriverWait(driver, 10);
|
||||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='wrapper']")));
|
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='wrapper']")));
|
||||||
|
|
||||||
|
String text= driver.findElement(By.xpath("//div[@class='ui-paging-info']")).getText();
|
||||||
|
System.out.println("Total Interactions count: " + text);
|
||||||
|
Thread.sleep(3000);
|
||||||
|
|
||||||
try {
|
} 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;
|
int totalRowCount = 0;
|
||||||
boolean hasNextPage = true;
|
boolean hasNextPage = true;
|
||||||
|
|
||||||
|
@ -99,5 +124,5 @@ public class Track_Interaction_Count
|
||||||
}
|
}
|
||||||
driver.quit();
|
driver.quit();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.openqa.selenium.chrome.ChromeDriver;
|
||||||
import org.openqa.selenium.chrome.ChromeOptions;
|
import org.openqa.selenium.chrome.ChromeOptions;
|
||||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
@ -20,11 +21,12 @@ import io.github.bonigarcia.wdm.WebDriverManager;
|
||||||
|
|
||||||
public class Track_Interaction_Export
|
public class Track_Interaction_Export
|
||||||
{
|
{
|
||||||
|
@Test
|
||||||
public static void main(String[] args) throws InterruptedException
|
public static void main(String[] args) throws InterruptedException
|
||||||
{
|
{
|
||||||
ChromeOptions options = new ChromeOptions();
|
ChromeOptions options = new ChromeOptions();
|
||||||
// Set the download directory
|
// 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
|
// Disable the download prompt
|
||||||
options.setExperimentalOption("prefs",
|
options.setExperimentalOption("prefs",
|
||||||
ImmutableMap.of("download.prompt_for_download", false, "download.directory_upgrade", true));
|
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);
|
WebDriverWait wait = new WebDriverWait(driver, 30);
|
||||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//a[@data-original-title='Export Interaction Detail into Excel format']")));
|
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()) {
|
if (downloadedFile.exists()) {
|
||||||
System.out.println("Downloaded file exists.");
|
System.out.println("Downloaded file exists.");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.openqa.selenium.chrome.ChromeDriver;
|
||||||
import org.openqa.selenium.chrome.ChromeOptions;
|
import org.openqa.selenium.chrome.ChromeOptions;
|
||||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
|
||||||
|
@ -20,12 +21,14 @@ import io.github.bonigarcia.wdm.WebDriverManager;
|
||||||
|
|
||||||
public class Track_Medinsght_Export
|
public class Track_Medinsght_Export
|
||||||
{
|
{
|
||||||
|
@Test
|
||||||
public static void main(String[] args) throws InterruptedException
|
public static void main(String[] args) throws InterruptedException
|
||||||
{
|
{
|
||||||
|
|
||||||
ChromeOptions options = new ChromeOptions();
|
ChromeOptions options = new ChromeOptions();
|
||||||
// Set the download directory
|
// 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
|
// Disable the download prompt
|
||||||
options.setExperimentalOption("prefs",
|
options.setExperimentalOption("prefs",
|
||||||
ImmutableMap.of("download.prompt_for_download", false, "download.directory_upgrade", true));
|
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);
|
WebDriverWait wait = new WebDriverWait(driver, 30);
|
||||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@class='excelExportIcon sprite_iconSet tooltip-demo tooltop-left']")));
|
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()) {
|
if (downloadedFile.exists()) {
|
||||||
System.out.println("Downloaded file exists.");
|
System.out.println("Downloaded file exists.");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import org.openqa.selenium.WebElement;
|
||||||
import org.openqa.selenium.chrome.ChromeDriver;
|
import org.openqa.selenium.chrome.ChromeDriver;
|
||||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import Utilities.ConfigReader;
|
import Utilities.ConfigReader;
|
||||||
import Utilities.readConfigFile;
|
import Utilities.readConfigFile;
|
||||||
|
@ -17,13 +18,14 @@ import io.github.bonigarcia.wdm.WebDriverManager;
|
||||||
|
|
||||||
public class Track_Medinsight_Count
|
public class Track_Medinsight_Count
|
||||||
{
|
{
|
||||||
|
@Test
|
||||||
public static void main(String[] args) throws InterruptedException
|
public static void main(String[] args) throws InterruptedException
|
||||||
{
|
{
|
||||||
WebDriverManager.chromedriver().setup();
|
WebDriverManager.chromedriver().setup();
|
||||||
WebDriver driver = new ChromeDriver();
|
WebDriver driver = new ChromeDriver();
|
||||||
ConfigReader config = new ConfigReader();
|
ConfigReader config = new ConfigReader();
|
||||||
// Define the sets you want to use
|
// 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"};
|
//String[] sets = {"set"};
|
||||||
Thread.sleep(10000);
|
Thread.sleep(10000);
|
||||||
for (String set : sets) {
|
for (String set : sets) {
|
||||||
|
@ -50,8 +52,28 @@ public class Track_Medinsight_Count
|
||||||
WebDriverWait wait = new WebDriverWait(driver, 10);
|
WebDriverWait wait = new WebDriverWait(driver, 10);
|
||||||
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='wrapper']")));
|
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='wrapper']")));
|
||||||
|
|
||||||
|
String text= driver.findElement(By.xpath("//div[@class='ui-paging-info']")).getText();
|
||||||
|
System.out.println("Total MedInsight count: " + text);
|
||||||
|
Thread.sleep(3000);
|
||||||
|
|
||||||
try {
|
} 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;
|
int totalRowCount = 0;
|
||||||
boolean hasNextPage = true;
|
boolean hasNextPage = true;
|
||||||
|
|
||||||
|
@ -94,7 +116,7 @@ public class Track_Medinsight_Count
|
||||||
}
|
}
|
||||||
driver.quit();
|
driver.quit();
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ public class ConfigReader
|
||||||
public ConfigReader() {
|
public ConfigReader() {
|
||||||
properties = new Properties();
|
properties = new Properties();
|
||||||
try {
|
try {
|
||||||
FileInputStream fis = new FileInputStream("/home/aissel/git4/src/test/resources/browser-config.properties");
|
FileInputStream fis = new FileInputStream(System.getProperty("user.dir")+"/src/test/resources/browser-config.properties");
|
||||||
properties.load(fis);
|
properties.load(fis);
|
||||||
fis.close();
|
fis.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<suite name="Suite">
|
<suite name="Suite">
|
||||||
<test thread-count="5" name="Test" junit="true">
|
<test thread-count="5" name="Test" junit="true">
|
||||||
<classes>
|
<classes>
|
||||||
<class name="StepDefinitions.testRunnerTest"/>
|
<class name="test.Contacts_Count"/>
|
||||||
</classes>
|
</classes>
|
||||||
</test> <!-- Test -->
|
</test> <!-- Test -->
|
||||||
</suite> <!-- Suite -->
|
</suite> <!-- Suite -->
|
||||||
|
|
Loading…
Reference in New Issue