What did you try and what error did you get?  I only supplied high-level 
prototypes not code for you to insert.
Are you on the latest version of Watir-webdriver? The alert class was not 
available in older versions (2 years+) of watir-webdriver.
The group can provide detailed assistance if you show your test code.

Usually that file popup is a modal OS or windows dialog.
After your code clicks to bring up the popup add the next line of code
puts ' Alert found: ' + browser.alert.exists?.to_s

   - If it evaluates to true then you can use the alert features.  
   - If not search this group for the subject autoIT you will find lots of 
   information.  There is an autoIT gem or a standalone install.  I will not 
   detail how to use AutoIT.
   


   - It might be that there is a hidden input for the file upload (but 
   setting that input is a hack and not a recommended procedure)
   - You may consider browser.send_keys('the string') Search the group for 
   send_keys





On Wednesday, September 30, 2015 at 3:34:14 AM UTC-5, VIDYA SAGAR POGIRI 
wrote:
>
> Hi thanks for the reply but the code which you have sent is not working so 
> kindly provide any other code .
> THanks 
>
> On Friday, September 25, 2015 at 6:54:19 PM UTC+5:30, Super Kevy wrote:
>>
>> 1. Had it been a standard control I would have suggested something like: 
>> browser.file_field.set 'C:/watir.txt'
>> 2. Consider trying the alert api.  this reference 
>> http://watirwebdriver.com/javascript-dialogs/
>> - It may be as simple as  
>> # Enter text to prompt
>> browser.alert.set "C:/watir.txt"
>> 3. Finally AutoIt
>>
>>
>> On Thursday, September 24, 2015 at 9:08:29 AM UTC-5, VIDYA SAGAR POGIRI 
>> wrote:
>>>
>>> Hi I'm using WATIR WEB DRIVER  for writing test scripts using POM , and 
>>> i came across a situation in which i have to upload an image.Also I've 
>>> attached the xpath for the button
>>>
>>> In the below screens I have a button *Upload Image , *if we click on it 
>>> a File Upload pop up opens.My question is how to set the images path and 
>>> select the images.
>>>
>>> Kindly help me out .Thanks
>>>
>>>
>>>
>>>
>>>
>>>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to