Test msg
-
09.29.2024 1:57:14 AM
-
09.29.2024 1:57:14 AM
+
09.29.2024 5:09:44 PM
+
09.29.2024 5:09:44 PM
00:00:00:000
·
#test-id=1
@@ -115,13 +115,13 @@
Started
-
Sep 29, 2024 01:57:12 AM
+
Sep 29, 2024 05:09:42 PM
Ended
-
Sep 29, 2024 01:57:15 AM
+
Sep 29, 2024 05:09:44 PM
diff --git a/src/main/java/zacksolutions/pages/HomePage.java b/src/main/java/zacksolutions/pages/HomePage.java
index 57cfe4c..1fef243 100644
--- a/src/main/java/zacksolutions/pages/HomePage.java
+++ b/src/main/java/zacksolutions/pages/HomePage.java
@@ -6,29 +6,30 @@ import org.openqa.selenium.support.PageFactory;
import zacksolutions.base.Initialization;
public class HomePage extends Initialization {
- //Using PageFactory Object Model we get our elemets
- @FindBy(id="message")
- WebElement message;
+ // Using PageFactory Object Model we get our elemets
+ @FindBy(id = "message")
+ WebElement message;
- @FindBy(css="button[type='submit']")
- WebElement button;
+ @FindBy(css = "button[type='submit']")
+ WebElement button;
- @FindBy(css="tbody tr:nth-child(1) td:nth-child(1)")
- WebElement ConfirmText;
+ @FindBy(xpath = "//tbody/tr[1]/td[1]")
+ WebElement ConfirmText;
- //Initialization
- public HomePage(){
- PageFactory.initElements(driver, this);
- }
+ // Initialization
+ public HomePage() {
+ PageFactory.initElements(driver, this);
+ }
- //Actions
- public void insertText() throws InterruptedException {
- test = extent.createTest("Test msg");
- message.sendKeys("4 8 15 16 23 42");
- button.click();
- extent.flush();
- }
- public String textConfirmation(){
- return ConfirmText.getText();
- }
+ // Actions
+ public void insertText() throws InterruptedException {
+ test = extent.createTest("Test msg");
+ message.sendKeys("4 8 15 16 23 42");
+ button.click();
+ extent.flush();
+ }
+
+ public String textConfirmation() {
+ return ConfirmText.getText();
+ }
}
diff --git a/src/test/java/zacksolutions/HomePageTest.java b/src/test/java/zacksolutions/HomePageTest.java
index 888b562..2a50b2f 100644
--- a/src/test/java/zacksolutions/HomePageTest.java
+++ b/src/test/java/zacksolutions/HomePageTest.java
@@ -23,10 +23,11 @@ public class HomePageTest extends Initialization {
@Test
public void TextTest() throws InterruptedException {
- HomePage hp = new HomePage();
- hp.insertText();
- hp.textConfirmation();
- Assert.assertEquals(hp.textConfirmation(), "4 8 15 16 23 42");
+ System.out.println(driver.getTitle());
+ // HomePage hp = new HomePage();
+ // hp.insertText();
+ // hp.textConfirmation();
+ // Assert.assertEquals(hp.textConfirmation(), "4 8 15 16 23 42");
}
@AfterTest