Selenium execution halts when click button is clicked until an event is finished

120 views
Skip to first unread message

Shivanshu Vashist

unread,
Nov 7, 2014, 9:34:14 AM11/7/14
to seleniu...@googlegroups.com
Our application has two buttons one for start upload and one for stop upload. The problem is when we click the star upload button selenium waits for the upload process to complete and we are not able to stop the upload process :(. I want to click the stop button in between the upload process and stop the process.

Ravindra

unread,
Nov 10, 2014, 1:44:42 AM11/10/14
to seleniu...@googlegroups.com
What Exception you are seeing at Console??  also  share AUT url if possible and the code you have tried so far.


Regards,
~Ravindra

Shivanshu Vashist

unread,
Nov 10, 2014, 5:50:36 AM11/10/14
to seleniu...@googlegroups.com
Hi Ravindra,

Thanks for replying..!!

Sorry, but I cannot share the URL of the application with you since it is under test environment for us. But, it goes something like this:
This is a File Upload process:
1. User clicks Select File Button
2. Selects the file from Windows File upload window and the file gets displayed on the upload bar in AUT
3. Click on 'Start' Button
4. Percentage wise progress is displayed on the AUT but at this point the execution halts and does not come back to selenium. Code is unable to click on the stop button.

Tried whole lot of techniques from Actions(Clicking on x,y co-ordinate), Normal click action, submit etc. etc.

The problem is every time web driver clicks the stop button only after the upload process is over. Our need is that it should click in between the process.

I use xpath to click on the start button:
driver.findElement(By.xpath("//*[@id='uploader_start']/span[2]").click();

After this the execution comes back to the next line only after the upload process is completed :(.
So the next line to stop upload works but is of no use.

driver.findElement(By.xpath("//*[@id='uploader_stop']/span[2]").click();

Appreciate any help on this..!!

Thanks,
Shivanshu

PeterJeffreyGale

unread,
Nov 10, 2014, 5:56:52 AM11/10/14
to seleniu...@googlegroups.com
Are you actually able to click on the stop upload button when you open the page manually and does it stop the file from being uploaded?

Shivanshu Vashist

unread,
Nov 10, 2014, 7:40:56 AM11/10/14
to seleniu...@googlegroups.com
Hey Peter,

Yes, the AUT does allow us to stop the process manually. The issue is only when automating it. 

PeterJeffreyGale

unread,
Nov 10, 2014, 7:51:27 AM11/10/14
to seleniu...@googlegroups.com
Then I think you need to discuss this issue with the developers ... they will have the tools and access to determine what happens differently when you reference a specific element using the automation than when using the app manually.

Shivanshu Vashist

unread,
Nov 10, 2014, 7:59:16 AM11/10/14
to seleniu...@googlegroups.com
Okay, Peter definitely I was going to do that. But, before doing so I thought there was any way to handle such a situation. Anyhow, thanks for the replies.

Greatly Appreciated...!!

Thanks & Regards,
Shivanshu 

PeterJeffreyGale

unread,
Nov 10, 2014, 8:07:21 AM11/10/14
to seleniu...@googlegroups.com
Webdriver should block events only if they are blocked for real users, e.g. on page load. I suspect that the element you are clicking on in the automation is not quite the same as the one that gets triggered when the user clicks on the screen.

If your developer can help you prove that WebDriver is creating a blocking event when non is triggered for a real user of your app, then that would be a a bug in WebDriver that you can raise with the Selenium developers ... but you'll need a reproducible test on a public page for them to be able to look into fixing it if it really is a bug.

Shivanshu Vashist

unread,
Nov 10, 2014, 8:40:46 AM11/10/14
to seleniu...@googlegroups.com
Sure, I shall check out with the devs and post it once we get a possible answer. Thanks again Peter..!!

musica

unread,
Dec 18, 2014, 1:55:02 AM12/18/14
to seleniu...@googlegroups.com
Hi Shivanshu,

Are u able to resolve above mentioned issue.Thanks!
Reply all
Reply to author
Forward
0 new messages