CompiledScript.OpenFileDialogHandler Method

Definition

Supports a file upload scenario. Handles a file upload dialog that opens on a mouse click on the <input type=”file”> element.

For more recommendations see File Upload Recording

public void OpenFileDialogHandler(button OpenFileDialogButton, string[] fileNames = null))

Parameters

 button  OpenFileDialogButton

 fileNames  string [ ]

Download URL Examples

For upload test purposes, you can use the following example files from publicly available URLs:

  • https://d149yd38g6ldk.cloudfront.net/LoremIpsum.docx
  • https://d149yd38g6ldk.cloudfront.net/LoremIpsum.pdf
  • https://d149yd38g6ldk.cloudfront.net/LoremIpsum.txt

Examples

Note that the file hosting platform utilized in the example below are provided for demonstration purposes only. You can use any file sharing and storage platforms which allow download.

//File Upload from the external URL
tab0.Link ("//P[normalize-space()=\"Upload Files\"]/..", "//LI[@ID=\"li-uploadFiles\"]//A", "//LI[@ID=\"li-api\"]/preceding-sibling::LI[1]//A").Click ();
tab0.Download ("LoremIpsum.docx", "https://d149yd38g6ldk.cloudfront.net/LoremIpsum.docx");
OpenFileDialogHandler (OpenFileDialogButton.Ok, new string[1] {"LoremIpsum.docx"});
tab0.Button ("//BUTTON[normalize-space()=\"Click here\"]", "//BUTTON[normalize-space(text())=\"Click here\"]", "//BUTTON[@ID=\"dropZoneBtnSelect\"]").Click ();