- Amit ChhikaraActive particpant
- Posts : 10
Join date : 2012-01-03
Not able to click on a Browse Button while uploading a file????
Wed Jan 18, 2012 7:18 pm
I am nt able to click on the browse button on a web page while uploading a file using selenium....
Could anyone will help me.....
Thnaks in advance !!!!!
Could anyone will help me.....
Thnaks in advance !!!!!
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Not able to click on a Browse Button while uploading a file????
Thu Jan 19, 2012 2:46 pm
May you paste some code?
Probably you have got something like this:
unfortunately. If you want to upload a file, you should put its path into the file input:
Probably you have got something like this:
- Code:
<i n p u t type="file" id="upload" name="upload">
- Code:
$this->click("upload");
unfortunately. If you want to upload a file, you should put its path into the file input:
- Code:
$this->type("upload", "C:/path/to/file/you/want/to/upload");
- Amit ChhikaraActive particpant
- Posts : 10
Join date : 2012-01-03
Re: Not able to click on a Browse Button while uploading a file????
Thu Jan 19, 2012 3:07 pm
faramka wrote:May you paste some code?
Probably you have got something like this:
So simply:
- Code:
<i n p u t type="file" id="upload" name="upload">
But what do you want to do then? You are not able to handle a browse window,
- Code:
$this->click("upload");
unfortunately. If you want to upload a file, you should put its path into the file input:
- Code:
$this->type("upload", "C:/path/to/file/you/want/to/upload");
- Code:
$this->type("upload", "C:/path/to/file/you/want/to/upload");
this code is working for me it is typing the address in to browse textbox button......but its not submitting the form and file is not uploading.....how to upload the file.
Please help me in the above regards....
Thnaks for reply....
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Not able to click on a Browse Button while uploading a file????
Thu Jan 19, 2012 4:13 pm
Browse button just opens the browse dialog (where you can explore disks and find file to choose).
You must click submit button to submit form and then the file will be uploaded successfully.
If you want resolve this issue, please paste some code of your form. It will really help me to give your some clues.
You must click submit button to submit form and then the file will be uploaded successfully.
If you want resolve this issue, please paste some code of your form. It will really help me to give your some clues.
- Amit ChhikaraActive particpant
- Posts : 10
Join date : 2012-01-03
Re: Not able to click on a Browse Button while uploading a file????
Thu Jan 19, 2012 5:06 pm
faramka wrote:Browse button just opens the browse dialog (where you can explore disks and find file to choose).
You must click submit button to submit form and then the file will be uploaded successfully.
If you want resolve this issue, please paste some code of your form. It will really help me to give your some clues.
- Code:
selenium.open("http://www.naukri.com");
selenium.waitForPageToLoad("30000");
selenium.type("id=username", "amit.chhikara@gmail.com");
selenium.type("id=password", "011908101");
selenium.click("name=Login");
selenium.waitForPageToLoad("30000");
selenium.click("id=preview");
selenium.waitForPageToLoad("30000");
selenium.click("//div[@id='content']/div/div[9]/div[2]/div[3]/table/tbody/tr/td/a[3]/u");
selenium.waitForPageToLoad("30000");
//String[] commands1 = new String[]{};
//commands1 = new String[]{"C:\\workspace_AMIT\\ProfileUpload\\bowsebutton.exe"}; //location of the autoit executable
http://Runtime.getRuntime().exec(commands1);
// String[] commands = new String[]{};
// commands = new String[]{"C:\\workspace_AMIT\\ProfileUpload\\FileUpload.exe"}; //location of the autoit executable
// Runtime.getRuntime().exec(commands);
selenium.type("browsecv","E:\\My Profiles\\Selenium CV\\Testing Selenium");
//selenium.click("//*[@id='browsecv']");
//Here we need to call Autoit Script
Thread.sleep(2000);
//submit[@id='submit']
//selenium.submit("id=submit" );
selenium.click("//*[@id='submit']");
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: Not able to click on a Browse Button while uploading a file????
Thu Jan 19, 2012 5:16 pm
OK, I see you have got submitting command now.
But submitting is running a while, so you should use also waitForPageToLoad() after this line:
But submitting is running a while, so you should use also waitForPageToLoad() after this line:
- Code:
selenium.click("//*[@id='submit']");
- Code:
selenium.click("submit");
- (Selenium Webdriver) Not able to click BROWSE button while uploading a file in GWT Framework
- How do i get the Xpath value for a radio button so i can click the button on a form
- Select the “back” button of the Firefox browser to right click and Select the Option from the right click Menu in Selenium Web Driver - Java
- Uploading a file through YUI Upload Component using Selenium Webdriver with Java
- Cannot click on button
Permissions in this forum:
You cannot reply to topics in this forum