How to handle timeout error in web driver when we run selenium as automation pack?
i have created selenium journey with the Selenium IDE and i have converted to Selenium web driver code and imported to visual studio 2012 with the help of developer.
Automation pack contains 30 journeys in total. Those 30 Journey will run one after another and it is scheduled for 6 time / day.
when i executing selenium journey manually by executing c# program, normal i couldn’t find any errors but when it is automated mode we used to get errors like out of 30 , 26 journeys are pass and 4 fail. if i run manually then those 4 journey ll pass. when it fail, error log mostly will be time out error.
My waiting time per page is about 60 seconds. It more than enough for web page.
In create failed journey make selenium untrusted for automation testing in my team.
Does anyone can suggest why i am getting this kind of error when set to automation mode?
Please suggest some solution for this.
You got me wrong. I did not want you to increase the wait time to 60 secs and I assume that you are increasing that wait time in your implicitly wait statement. That is not the issue here.
To cut it short just to find out the root cause, add Thread.sleep(1000) after every click(). You will see that after this no test will fail. If it is too much to do then implement logging and get all the failure elements and add sleep just before clicking those elements.
This is not the solution but to get the idea what is going wrong here. If this works, then I will tell you the logic behind it.
You are correct and this always happens at initial statge of frameworks. Implement logging in your test and get the list of those entire elements on which selenium throws error intermittently. You need to implement wait smartly on those elements. Most of the time those elements load properly but once out of multiple they take some time to loador behave differently. If you are not worried about the time duration of the execution use enough thread sleep to give a smooth execution, although it is not recommended.
Thanks for reply Lakshay,
Extending waiting period more than 60 Seconds seems to be not a good solution , for some journey i have increased waiting time as 100 Sec.
after increasing as well those journey fails. so again i came back with 60 Sec for standard
right now i am using sleep cmd, do you suggest any other wait commands solve this issue.