Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
kovacsakos Super Contributor.
Super Contributor.
243 views

Send files to FileField

Jump to solution

I have a file upload field, like this:

browser.describe(FileField.class, new FileFieldDescription.Builder()
.tagName("INPUT")
.name("WebFile").build());

 How could I send input files to this field?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Send files to FileField

Jump to solution

Hi,

The setValue method should perform what you need.

 

Here is a code example:

Browser browser = BrowserFactory.launch(BrowserType.CHROME);
browser.navigate("http://jkorpela.fi/forms/file.html");

FileField datafileFileField = browser.describe(FileField.class, new FileFieldDescription.Builder()
.index(0)
.name("datafile")
.tagName("INPUT").build());

datafileFileField.setValue("c:\\1.png");

 

2 Replies
liorde Honored Contributor.
Honored Contributor.

Re: Send files to FileField

Jump to solution

Is this a sharepoint object?

Can you elaborate some more on your method of working on your AUT ?

 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Send files to FileField

Jump to solution

Hi,

The setValue method should perform what you need.

 

Here is a code example:

Browser browser = BrowserFactory.launch(BrowserType.CHROME);
browser.navigate("http://jkorpela.fi/forms/file.html");

FileField datafileFileField = browser.describe(FileField.class, new FileFieldDescription.Builder()
.index(0)
.name("datafile")
.tagName("INPUT").build());

datafileFileField.setValue("c:\\1.png");

 

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.