1 member
1 member
6 members
1 member
12 members
10 members
9 members
3 members
2 members
8 members
Get the xpath of upload text field thru firebug addon. Then add manual path of the file in the code. Then selenium.click('upload'). Hope this will resolve your problem
Permalink Reply by Marichamy on April 4, 2011 at 9:59pm Dear Tulsi,
Please follow below sample to upload the your attachments.
selenium.type("browse", "C:\\zohotestautomation\\resources\\recruit\\candidateZip.xls");
Hope, this will help you.
Note: this is for window users.
Regards
Marichamy,
Permalink Reply by sachin on April 5, 2011 at 2:25pm Hi tulasiram,
Following steps may help u in uploading the file, replace browse and upload buttons with "element id" or "value" or "xpath of that button/link".
selenium.click("browse button");
selenium.waitForPageToLoad("max time to load in milliseconds");
selenium.type("upload field ID", "c:\\path of file to be uploaded from system, including filename and extension");
selenium.click("Upload button");
-Sachin
Permalink Reply by sachin on April 6, 2011 at 4:52pm hi tulsi,
Either u click on the browse button or the textbox, the post condition will be the upload file window.
Hence u can use any of them.
Usually user will not be able to manually add any text into the upload text field, it always opens the upload file window.
If you are able to identify the new upload window using the tool, u should not have problem in uploading a file else use selenium IDE and record your flow.
Permalink Reply by snehasish saha on April 5, 2011 at 5:49pm Its too much easy just on the selenium record when you are uploading something after that stop recording and change to source view from Table view and see the source. And use the same command everytime when you are uploading.
Thanks,
Snehasish
Permalink Reply by snehasish saha on April 14, 2011 at 3:29pm Try selenium IDE.Just record one instance.And then go to the source and give the path from where u want to upload any file. Its so simple.
One Funny thing I generally upload any pics or docs using Selenium IDE.
Thanks & Regards,
Snehasish
selenium.click('Browse')
Select your file and then upload.
Another way, is to record your test case thru selenium IDE and check for the steps
© 2013 Created by Test Republic.
Powered by
