cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IsaacR
Helper I
Helper I

Issue with Web UI selecting "Choose File" button

Hello,

 

My first ever flow is all completed but I am having issues with the Web UI on PAD selecting a "Choose File" button on a web page to select a file from my desktop to upload to the browser.

 

I cannot seem to either click on the icon or input the file path through PAD. I tried either "press button on web page" and it does nothing (was recorded from web recorder) and I also tried to capture the UI element and chose to select element but doesn't work as well. I also tried "Populate text Field on web page" for input:file with the text as the file path and also no go.

 

This is the field:

 

File.PNG

 

This is what I see with DevTool:

 

File 2.PNG

 

Here is the selection for the action

File 3.PNG

Here is the UI Element

 

File 4.PNG

 

Any help would be greatly appreciated.

10 REPLIES 10
fraenK
Memorable Member
Memorable Member

Your selector is looking for an empty input element ([Value=""]), your screenshot shows a non-empty one.

Is it empty by default?

Henrik_M
Resolver III
Resolver III

  1. Don't use Web Recorder, ever.
  2. Try if you can implement this technique in PAD to better activate the web element: How to send physical right/left click on web element | Microsoft Docs

Yes, it is empty by default and after I select the file it shows the way it does on the screenshot. When I look at the value through DevTools after I select a file, it looks like this:  "C:\fakepath\WCLeadImportSampleFile.csv"

 

 

burque505
Helper V
Helper V

@IsaacR, many frequent visitors don't like to use this function on web pages. I do. It's easy and usually works great. You can use DevTools to see if it's going to work before you commit to it.

I don't know if this will suit your needs, since I don't know what the page will do after you load the value. It should fill in that input at least. Of course if you want you can substitute a variable for what I have here (maybe 'C:\work\PAD\myFile.csv' with %myCsvFile%, for instance.)

(Running a JS function on the page should let you click the button if you choose to go that route, but I don't know what that button element looks like on the page. If you want, post the code for that button element and maybe I can help.)

 

capture.PNG

Regards,

burque505

Hello burque,

 

I tried everything but no go. I even tried with Selenium, added option to update URL's from the plugin, and I still get this error: code":-32000,“message”:“Not allowed”

 

I also tried it on Edge, reinstalled the plugin, and same issue.

 

I tried to paste the html source code but the board keeps erasing my response. Have been trying for days but no go. How can I paste it without the board removing the info?I keep on pasting it between the script command.

burque505
Helper V
Helper V

Well, first things first, let's see if you can get the code onto the board.

First click here:

first.PNG

That will expand the toolbar, as shown. Click on the indicated icon.

second.PNG

You should see this:

insert code sample.PNG

I suppose that's a proprietary URL you are using that you can't share, but if you can share it or at least a portion of it, that would also help. I guess you tried DevTools and running the JS I shared above on the page, right?

 

I think from the code you shared that the page uses the Angular framework. I generally cringe when I see that because I usually have to jump through hoops to fill forms or scrape.

Yes, I tried DevTools and running the JScript but no luck.

 

I tried to save the code just the way you mentioned above but it does not work.

 

Here are some images that I took of the relevant code:

 

Capture ph1.PNGCapture ph2.PNGCapture ph3.PNG

 

 

 

I think I made some progress. I recorded again through Selenium and one of the commands comes out as:

Command : Click

Target: id=file

Value: C:\Users\Isaac\Desktop\LeadImport.csv

 

I just changed the command type from Click > Type and voila!

 

Now I just need guidance in how to implement that in PAD.

burque505
Helper V
Helper V

Glad you're making progress. Just out of curiosity, are you using Selenium from an upgraded version (i.e. not free 😀) of PAD? I only have the free version. If not, which Selenium framework are you using (like C#, node.js, python, java)? Or maybe the Selenium IDE?

 

Anyway, that's just out of curiosity. If I would you I would try that 'Type text' activity on the element you found above, but after, perhaps, first a click or hover on that element. Sorry I don't have PAD available at the moment, so I can't do any kind of a test.

Selenium IDE (plugin).

 

I tried Set Focus on Text Field and I get "Failed to set input focus on web page text box."

If I try just going straight to Populate text Field on Web Page, I get " Failed to write text 'C:\Users\Isaac\Desktop\LeadImport.csv' in form field.

Here are the details:

 

Robin.Core.ActionException: Failed to write text 'C:\Users\Isaac\Desktop\LeadImport.csv' in form field. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Robin.Modules.WebAutomation.Actions.WebpageTextFieldPopulator.HandlePopulateTextResult(WebAutomationResult result)
at Robin.Modules.WebAutomation.Actions.WebpageTextFieldPopulator.WebExtensionsBrowserRun()
--- End of inner exception stack trace ---
at Robin.Modules.WebAutomation.Actions.PopulateTextFieldBase.Execute(ActionContext context)
at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

 

 

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (80,041)