Answers for "uploading files"

2

file upload

uploadFile(e){
    const file = e.target.files[0];
    storage.ref('images/'+ file.name).put(file)
      .then(response => {
        response.ref.getDownloadURL().then((downloadURL) => {
           firebase.database().ref(YOUR_DATABASE).child(THE_USER_ID).update({imageUrl:downloadURL})
      }                 
     .catch(err => console.log(err))
}
Posted by: Guest on May-18-2021
0

syntax for uploading a file

Public void fileUpload(Stirng path){ 
WebELement upload = driver.findELement; Upload.sendKeys(path)
} 
• We need to locate the upload button in html. 
• The element will have tag input. 
• Then we do sendKeys by passing the path to file which we want to upload
Posted by: Guest on June-15-2021
1

how to upload

In order to upload file using selenium we need to locate the upload button 
in the DOM html. Then we do sendKeys by passing the path to the file. 

First, I locate the element which takes the path of the file(Choose file button) :
      WebElement input = driver.findElement(“id”); 
 And then I provide the path to the file using the sendKeys method :
      input.sendKeys(“/path/to/file” + Keys.ENTER);
Posted by: Guest on December-04-2020

Browse Popular Code Answers by Language