I am automating test cases in which I have to upload a folder on Google drive. I am able to successfully click and upload folder by path but immediately when I click on upload button of browse windows the alert appears on top middle of the screen saying 'This will upload all files from "folderName". Only do this if you trust this site." (see attached image) There are two buttons 'Upload' and Cancel but there is no way I can identify those element. I tried all possible approaches.
Is there any other way to handle that security alert. I found following info about the alert.
How to remove warning message in Chrome when uploading a directory
uploadFolder(folderToUpload, 5000);
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_LEFT);
robot.keyPress(KeyEvent.VK_ENTER);
I faced the same problem and to solve this I have used Sikuli. Sikuli will identify the pop-up as per the image. (you need to capture the screenshot of that pop-up).
Try searching for Sikuli on google and you can find lot of stuff about implementation and all. Hope this will help.