|
package automationFramework; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import page_objects.*; public class Customer_create_ticket { //static WebDriver driver; public static void main(String[] args) throws InterruptedException{ //System.setProperty("webdriver.chrome.driver", "/home/users/shivani.kukreti/Downloads/chromedriver"); // System.setProperty("webdriver.gecko.driver", "/home/users/shivani.kukreti/Downloads/Documents/geckodriver"); WebDriver driver = LogIn_PG_POF.LogIn_PG_POF(); WebDriverWait wait = new WebDriverWait(driver, 80); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.get("https://qa-webkul.myshopify.com/account/login"); // This is to Instantiate Home Page and LogIn Page class LogIn_PG_POF LoginPage = PageFactory.initElements(driver, LogIn_PG_POF.class); // Once both classes Initialised, use their Web Element Objects LoginPage.ClickEnterpassword.click(); LoginPage.Enterpassword.sendKeys("rtuyez"); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); //WebElement Enter = wait.until(ExpectedConditions.visibilityOfElementLocated(By.name("commit"))); Thread.sleep(4000); LoginPage.Enter.click(); //Customer click on customer profile logo LoginPage.clickcustomerlogo.click(); //Enter Customer Email LoginPage.txtbx_UserName.sendKeys("shivanikukreti.symfony129@webkul.com"); //Enter password LoginPage.txtbx_Password.sendKeys("webkul123"); //Enter on login LoginPage.btn_Login.click(); //Enter on Tickets LoginPage.btntickets.click(); //click on Create-ticket LoginPage.create_ticket.click(); //wait driver for 10 sec driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); //click on Ticket type LoginPage.click_type.click(); //Select Ticket type LoginPage.select_type.click(); //Enter subject LoginPage.subject.sendKeys("Shopify"); //Enter message LoginPage.message.sendKeys("This is Message"); //Add Attachment LoginPage.Attachment_Add.sendKeys("/home/users/shivani.kukreti/Documents/blog-db.png"); //click on create ticket LoginPage.Create_ticket.click(); Thread.sleep(2000); System.out.println(" Login Successfully, now it is the
|