Tuesday, 22 August 2017

Code Example - File Upload By Sendkeys

package com.seleniumWebdriver;

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

public class FileUploadBySendkeys extends SuperTestNG {

/**
  * @Blog Name : Selenium Code Example
* @author Deepak Gupta
* @Created Date 23-08-2017
*
*/

@Test
public void testFileUploadBySendkeys() {
try {
driver.get("http://only-testing-blog.blogspot.in/2013/09/testing.html");
driver.findElement(By.name("img")).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...