Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How to Upload File/Photo using “Upload Image Button” in Selenium Webdriver

View previous topic View next topic Go down

How to Upload File/Photo using “Upload Image Button” in Selenium Webdriver

Post by Niyati on Thu Sep 26, 2013 5:22 pm

Code:
  WebElement UploadImg = driver.findElement(By.xpath("//*[@id='file_upload_button']"));
  UploadImg.click();
  WebElement frame =driver.switchTo().activeElement();
  frame.sendKeys("d:\5.jpg");
This code just open system window but it doesn't select any Photo/File
Neutral

Niyati

Posts : 1
Join date : 2013-09-26

Back to top Go down

Re: How to Upload File/Photo using “Upload Image Button” in Selenium Webdriver

Post by rohit13 on Mon Oct 07, 2013 2:01 am

You can not handle that pop-up in this way, but you can directly pass path of your file with sendkeys with upload button locator.

_________________
Radical QA
http://radical-qa.blogspot.in/

rohit13
Master
Master

Posts : 180
Join date : 2012-03-29
Age : 30
Location : INDIA

http://radical-qa.blogspot.in/

Back to top Go down

Re: How to Upload File/Photo using “Upload Image Button” in Selenium Webdriver

Post by nabhanya.varma on Tue Dec 16, 2014 12:30 am

First and the Easy way is simple case of just finding the element and typing the absolute path of the document into it using SendKeys. But that may not work for cases where customized button is used.

You need to go for AutoIt tool or Using Robots class
Check the below link for examples:

Upload Document/File
http://seleniumeasy.com/tags/upload

nabhanya.varma
Active particpant
Active particpant

Posts : 13
Join date : 2014-03-02

Back to top Go down

Re: How to Upload File/Photo using “Upload Image Button” in Selenium Webdriver

Post by Sponsored content Today at 9:05 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum