Commit 29fbd8c4 authored by Qazi Zain's avatar Qazi Zain

Second commit assertion added in Existing Code

parent b2bd1e4c
...@@ -6,6 +6,7 @@ import org.openqa.selenium.WebDriver; ...@@ -6,6 +6,7 @@ import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxDriver;
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.Assert;
import java.time.Duration; import java.time.Duration;
...@@ -14,7 +15,7 @@ public class AllTypeLocators { ...@@ -14,7 +15,7 @@ public class AllTypeLocators {
public static void main(String[] args) throws InterruptedException { public static void main(String[] args) throws InterruptedException {
WebDriver obj = new FirefoxDriver(); WebDriver obj = new FirefoxDriver();
//addinng waiting mechanisim to avoid to fail due to timeout issue. //adding waiting to avoid to fail due to timeout issue.
obj.manage().timeouts().implicitlyWait(Duration.ofSeconds(5)); obj.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
...@@ -99,5 +100,9 @@ public class AllTypeLocators { ...@@ -99,5 +100,9 @@ public class AllTypeLocators {
System.out.println("After login :"+dilouge); System.out.println("After login :"+dilouge);
Assert.assertEquals(obj.findElement(By.xpath("//div[@class='login-container']/h2")).getText(),"Hello Qazi"); // to test the actual vs expected.
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment