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");
}
}
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");
}
}
can we use AutoIt tool for uploading the docs ?
ReplyDeleteworks in the older version of Naukri.co
ReplyDelete