Change File Field

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Example)
 
(6 intermediate revisions by one user not shown)
Line 1: Line 1:
 
This command is part of the [[Browser Commands|Browser Command]]. This command selects a file from your system and places it into the selected file field on the page.
 
This command is part of the [[Browser Commands|Browser Command]]. This command selects a file from your system and places it into the selected file field on the page.
 +
 +
 +
 
This includes fields or Choose File buttons on a webpage that requires you to upload a file.
 
This includes fields or Choose File buttons on a webpage that requires you to upload a file.
 +
 +
'''File Field Element:''' The selected file field that is being changed. (See [[The Selectors]] for more information)
 +
 +
'''File to Use:''' Inserts the file path of whatever file is selected through the browse button in the open file dialog.
 +
  
 
== Example ==
 
== Example ==
Line 7: Line 15:
 
navigate("http://cgi-lib.berkeley.edu/ex/fup.html", "Wait")
 
navigate("http://cgi-lib.berkeley.edu/ex/fup.html", "Wait")
  
change file field(<name="upfile">, "C:\\Users\\LillyT\\Downloads\\myfile.txt")
+
change file field(<name="upfile">, "C:\\Users\\Downloads\\myfile.txt")
 
</pre>
 
</pre>
  
[[File:changefile.png]]
+
[[File:changefile.jpg]]
 +
 
 +
 
 +
The command will allow you to browse your system for a file, and use the [[The Selectors|element selector]] to select the Choose File button.
 +
 
  
The command will allow you to browse your system for a file, and use the element selector to select the Choose File button.
+
[[File:changefile1.jpg]]
  
[[File:changefile1.png]]
 
  
 
Running the script fills the file field with the file provided in the change file field command.
 
Running the script fills the file field with the file provided in the change file field command.

Latest revision as of 22:34, 15 September 2013

This command is part of the Browser Command. This command selects a file from your system and places it into the selected file field on the page.


This includes fields or Choose File buttons on a webpage that requires you to upload a file.

File Field Element: The selected file field that is being changed. (See The Selectors for more information)

File to Use: Inserts the file path of whatever file is selected through the browse button in the open file dialog.


[edit] Example

navigate("http://cgi-lib.berkeley.edu/ex/fup.html", "Wait")

change file field(<name="upfile">, "C:\\Users\\Downloads\\myfile.txt")

Changefile.jpg


The command will allow you to browse your system for a file, and use the element selector to select the Choose File button.


Changefile1.jpg


Running the script fills the file field with the file provided in the change file field command.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox