Showing posts with label File Upload. Show all posts
Showing posts with label File Upload. Show all posts

Tuesday, May 27, 2014

How to upload resume in naukri.com

Note- here in the code just give the path of your file which you want to upload and run the code, it will upload your file in naukri.com. And Supported File Formats: doc, docx, rtf, pdf. Max file size: 300 Kb.
ex- path of the file which u want to upload = C:\\resume.doc

import java.util.Iterator;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class UploadResumeInNaukari {
    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        driver.get("http://www.naukri.com/");
       
        driver.findElement(By.xpath("//a[text()='Post Resume']")).click(); //click on post resume
       
        driver.switchTo().frame(driver.findElement(By.id("frmUpload"))); //browse button is under frame so 1st switch control to frame
        driver.findElement(By.id("browsecv")).sendKeys("path of the file which u want to upload");
       }
}


Sunday, May 11, 2014

How to upload the file.

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class FileUpload {
    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();
        driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
        driver.get("http://www.megafileupload.com/");
        driver.findElement(By.xpath("//input[@class='upload_txt']")).sendKeys("path of file to be uploaded");
        driver.findElement(By.cssSelector("input[id='terms']")).click();
        driver.findElement(By.cssSelector("input[name='send']")).click();
    }
}