0

enter image description here

I have a test that I would like to upload pictures to a website that uses the defaulted OS upload modal. After I click upload I cannot access the upload screen. Is there a way around it? I saw online that it looked like there was but I had no idea how to implement what they were saying.

element(By.xpath("//div[@id='ngdialog28']/div[2]/div/div[6]/div/span")).click()
element(By.css("input[type=\"file\"]")).click();
element(By.css("input[type=\"file\"]")).clear();
element(By.css("input[type=\"file\"]")).sendKeys("C:\\ProgramData\\MeetingMatrix International\\MeetingMatrix 2010\\MMIDEMO\\Setups\\Test.mms");
Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367
Nicole Phillips
  • 753
  • 1
  • 18
  • 41

1 Answers1

0

The answer below came from a previous post I had overlooked. Here is the code:

var path = require('path');

var fileToUpload = 'Put the path here',
  absolutePath = path.resolve(__dirname, fileToUpload);

$('input[type="file"]').sendKeys(absolutePath);
Nicole Phillips
  • 753
  • 1
  • 18
  • 41