Skip to content

Commit 9bfb0e1

Browse files
committed
Update dynamic password input
1 parent b28acca commit 9bfb0e1

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/java/dev/ypsilon/kitkrauler/Engine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void initialize(String[] args) {
3636
try {
3737
AbstractDriverOptions driverOptions = null;
3838

39-
if (args.length == 2) {
39+
if (args.length == 1) {
4040
validateInput(args);
4141

4242
switch (this) {

src/main/java/dev/ypsilon/kitkrauler/Execution.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.ypsilon.kitkrauler;
22

3+
import com.google.common.primitives.Chars;
34
import org.openqa.selenium.By;
45
import org.openqa.selenium.Keys;
56
import org.openqa.selenium.WebDriver;
@@ -8,8 +9,10 @@
89

910
import java.awt.*;
1011
import java.time.Duration;
12+
import java.util.Arrays;
1113
import java.util.HashMap;
1214
import java.util.List;
15+
import java.util.Scanner;
1316
import java.util.concurrent.TimeUnit;
1417

1518
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;
@@ -35,7 +38,8 @@ public Execution(WebDriver driver) throws AWTException {
3538

3639
public Execution(WebDriver driver, String[] credentials) throws AWTException {
3740
this.uName = credentials[0];
38-
this.pw = credentials[1];
41+
System.out.println("KIT-Account-Passwort für " + this.uName);
42+
this.pw = new String(System.console().readPassword(""));
3943

4044
this.driver = driver;
4145
execute();
@@ -75,6 +79,8 @@ public void execute() throws AWTException {
7579
driver.switchTo().frame(driver.findElement(By.id("registration")));
7680
gguid = driver.findElement(By.name("gguid")).getAttribute("value");
7781

82+
System.out.println("Login erfolgreich");
83+
7884
fetchData();
7985

8086
while (true) {

0 commit comments

Comments
 (0)