Friday, 4 August 2017

Code Example - File Upload By Sendkeys

package com.seleniumWebdriver;

import org.openqa.selenium.By;
import org.testng.annotations.Test;

/**
 * @Blog Name : Selenium Code Example
 * @author Deepak Gupta
 * @Created Date 4-08-2017
 *
 */
public class FileUploadSendkeys extends SuperTestNG {

@Test
public void handleCalendarPopup() {
try {

driver.get("http://only-testing-blog.blogspot.in/2013/09/testing.html");
driver.findElement(By.xpath(".//*[@id='post-body-7114928646577071695']/div[1]/div[1]/form[1]/input[8]")).sendKeys("D:\\FileDownload\\Testing Text.txt");
Thread.sleep(5000);
} catch (Exception e) {
e.printStackTrace();
}
}

}

No comments:

Post a Comment

Code Example - File Download By Robot Class In Firefox Browser

Exported from Notepad++ package com . practiceCode ; import java . awt . AWTException ; import java . awt . Robot ; import j...