Hi Sohani,
As I see the issue you are facing is web driver expects a element even
before it loads in the page.
One of the cleanest ways to do this is add a wait based on a condition.
WebDriverWait wait = new WebDriverWait(webDriver, timeoutInSeconds);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id<locator>));
else you can use RenderedWebElement to check whether the element is
rendered before proceeding
RenderedWebElement resultsDiv = (RenderedWebElement)
driver.findElement(By.className("gac_m"));
Mostly Selenium testing speed does not affect the test functionality. In
such case any way we have to handle the scenario irrespective of the speed
selinium executes the test.
Thank You,
Dharshana.
On Mon, Oct 20, 2014 at 6:37 PM, Malintha Adikari <[email protected]> wrote:
>
>
> On Mon, Oct 20, 2014 at 4:55 AM, Ayesha Dissanayaka <[email protected]>
> wrote:
>
>> Hi,
>>
>> I'm also having this concern while executing UI test cases in WSO2 ES.
>>
>> In my case ES Publisher App take ablout 15sec in order to populate
>> properly after completing indexing and all. Hence, I have to thread sleep
>> all the test classes. I would also like to know whether this is the
>> recommended way to slow down the web driver, or can we implicitly wait to
>> start the test execution by the framework.
>>
>> Thanks!
>> - Ayesha
>>
>> On Fri, Oct 17, 2014 at 10:10 AM, Sohani Weerasinghe <[email protected]>
>> wrote:
>>
>>> Hi,
>>>
>>> When using selenium web driver to write test cases, currently I am
>>> using Thread sleeps in order to control the speed of the browser. Is this
>>> the recommended way to slow down the execution speed?
>>>
>>> Selenium web driver has no method to control the speed of the tests. Yes
> ,the possible solution is hold the execution by implicit/explicit waiting
> (but not mixing them - [1] ). IMO, in the worst case we have to use thread
> sleep when we cannot find a way to use above web driver built in waiting
> methods.
>
> [1] http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp
>
> Regards,
> Malintha Adikari
>
> Please note that I am also using explicit waits to wait for certain
>>> conditions to occur before proceeding further and implicit waits to
>>> poll the DOM for a certain amount of time to find an element.
>>>
>>> Thanks,
>>> Sohani
>>> Sohani Weerasinghe
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>>
>>> Mobile : +94 716439774
>>> Blog :http://christinetechtips.blogspot.com/
>>> Twitter : https://twitter.com/sohanichristine
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Ayesha Dissanayaka*
>> Software Engineer,
>> WSO2, Inc : http://wso2.com
>> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
>> 20, Palmgrove Avenue, Colombo 3
>> E-Mail: [email protected] <[email protected]>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Malintha Adikari*
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> Mobile: +94 71 2312958
> Blog: http://malinthas.blogspot.com
> Page: http://about.me/malintha
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Dharshana Warusavitharana
Senior Software Engineer , Test Automation
WSO2 Inc. http://wso2.com
email : [email protected] <[email protected]>
Tel : +94 11 214 5345
Fax :+94 11 2145300
cell : +94770342233
blog : http://dharshanaw.blogspot.com
lean . enterprise . middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev