This repository was archived by the owner on Aug 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathHome_Page.java
More file actions
66 lines (58 loc) · 2.53 KB
/
Home_Page.java
File metadata and controls
66 lines (58 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package pageObjects;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import utility.CommonFunctions;
public class Home_Page {
private static WebElement element = null;
//Method to find login button on the home page
public static WebElement btn_Login(WebDriver driver){
element = CommonFunctions.FindElementWithExplicitWait(driver, By.id("btn_login"));
return element;
}
public static WebElement platformLink(WebDriver driver){
element = CommonFunctions.FindElementWithExplicitWait(driver, By.xpath("//*[@id='main-navigation-trading']/a"));
return element;
}
public static WebElement tradeNowLink(WebDriver driver){
element = CommonFunctions.FindElementWithExplicitWait(driver, By.xpath("//*[@id='trading-platforms']/div[1]/div[1]/div[2]/p[2]"));
return element;
}
public static WebElement acceptRealityCheck(WebDriver driver){
element = CommonFunctions.FindElementWithExplicitWait(driver, By.xpath("//*[@id='reality_check_nav']/button"));
return element;
}
//method to go find logo
public static WebElement logo(WebDriver driver){
WebDriverWait wait = new WebDriverWait(driver,60);
element = wait.until(ExpectedConditions.elementToBeClickable(By.id("logo")));
Assert.assertTrue(element.isDisplayed());
return element;
}
//Method to find Email text box on home page
public static WebElement txt_Email(WebDriver driver)
{
WebDriverWait wait = new WebDriverWait(driver,60);
element = wait.until(ExpectedConditions.elementToBeClickable(By.id("email")));
Assert.assertTrue(element.isDisplayed());
return element;
}
//Method to find create free account button on home page
public static WebElement btn_CreateFreeAccount(WebDriver driver){
WebDriverWait wait = new WebDriverWait(driver,60);
element = wait.until(ExpectedConditions.elementToBeClickable(By.id("btn_verify_email")));
Assert.assertTrue(element.isDisplayed());
return element;
}
//Method to find upgrade to a real account link on home page
public static WebElement link_UpgradeToRealAccount(WebDriver driver){
WebDriverWait wait = new WebDriverWait(driver,60);
element = wait.until(ExpectedConditions.elementToBeClickable(By.id("topbar-msg")));
Assert.assertTrue(element.isDisplayed());
WebElement link = element.findElement(By.linkText("Upgrade to a Real Account"));
return link;
}
}