AutoIT
Autoit is a freeware windows testing tool. Autoit allows you accessing windows components similar to QTP. Basically once you have identified the id of the component on the screen you can use it by either clicking on it, typing in something. Using Autoit we can identify the internet explorer “Choose file” or Firefox
“File Upload” windows and enter the correct value to the input
field after which you will press the open button.
Step to click on browse button.
Step 1.
Download the AutoIT and intall it.
Download AutoIT
setp 2.
write a AutoIT script to click on browse button and save it.
#include <IE.au3>
; Internet Explorer is partly integrated in shell.application
$oShell = ObjCreate("shell.application") ; Get the Windows
Shell Object
$oShellWindows=$oShell.windows ; Get the
collection of open shell Windows
$MyIExplorer=""
for $Window in $oShellWindows ; Count all existing
shell windows
; Note: Internet Explorer appends a slash to the URL in it's
window name
if StringInStr($Window.LocationURL,"http://") then
$MyIExplorer=$Window
exitloop
endif
next
$oForm = _IEGetObjByName ($MyIExplorer, "UploadedFile")
_IEAction($oForm, "click")
setp 3.
Compile AutoIT script and make exe file of that script.
Right click on that saved script file and click on "Compile script" from context menu. This will make an exe file of that script.
setp 4.
Call that exe in selenium.
Process proc = Runtime.getRuntime().exec("C:\\Documents and Settings\\nirkumar\\Desktop\\Browse.exe");
This will click on browse button and open choose file or upload file dialog box.Download AutoIT script
Download exe of that script
If you want to test this script works then download the exe and open the page which has browse button and run(double click on this exe) this exe file. i am sure this
will click on your browse button and open a dialog box. If it does not then definitely your browse button has some other name than "UploadedFile" then in the step 2 change the button name and make exe of that script and run it.
NOTE: This will work in Internet explorer.
Whats about firefox and other browser? do u have code to click on browse button in other browser ?
ReplyDeleteNote : In our application, Browse button is a html element.
Process proc = Runtime.getRuntime().exec("C:\\Documents and Settings\\nirkumar\\Desktop\\Browse.exe");
ReplyDeleteHow to Call that exe in selenium for C# language the example you gave its for java I think
Please help!!!
Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium.
ReplyDeleteSelenium
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeletePython Training in electronic city
DataScience with Python Training in electronic city
AWS Training in electronic city
Big Data Hadoop Training in electronic city
Devops Training in electronic city
We can teach you Automation Anywhere from basic level to advance level. Please visit our website for more info: Best Automation Anywhere Training Institute in Chennai
ReplyDeleteForex Broker Canada Forex Broker USA Top List Of Forex Brokers By Country. Compare Forex Brokers, Forex Trading Platforms & Forex Indicators.
ReplyDeleteInfycle Technologies, the top software training institute and placement center in Chennai offers the best
ReplyDeleteData science training in Chennai for freshers, students, and tech professionals at the best offers. In addition to Digital Marketing, other in-demand courses such as DevOps, Big Data, Cyber Security, Python, Selenium, Big Data, Java, Power BI, Oracle will also be trained with 100% practical classes. Call 7504633633 to get more info and a free demo.
Superb blog and great post.Its truly supportive for me, anticipating for all the more new post. Continue Blogging!
ReplyDeleteevs full form
raw agent full form
full form of tbh in instagram
dbs bank full form
https full form
tft full form
pco full form
kra full form in hr
tbh full form in instagram story
epc full form