Re: [Dev] Reduce the execution speed of Web Driver
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.idlocator)); 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 malin...@wso2.com wrote: On Mon, Oct 20, 2014 at 4:55 AM, Ayesha Dissanayaka aye...@wso2.com 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 soh...@wso2.com 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 Dev@wso2.org 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.comsa=Dsntz=1usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg 20, Palmgrove Avenue, Colombo 3 E-Mail: aye...@wso2.com ayshsa...@gmail.com ___ Dev mailing list Dev@wso2.org 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 Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Dharshana Warusavitharana Senior Software Engineer , Test Automation WSO2 Inc. http://wso2.com email : dharsha...@wso2.com dharsha...@wso2.com Tel : +94 11 214 5345 Fax :+94 11 2145300 cell : +94770342233 blog : http://dharshanaw.blogspot.com lean . enterprise . middleware ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Reduce the execution speed of Web Driver
Hi, On Mon, Oct 20, 2014 at 10:25 AM, Ayesha Dissanayaka aye...@wso2.com 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. Never use thread sleeps for waits unless it is really required and no any other way to achieve page waits. You need to write your own wait function based on the elements you are expecting to be visible in next step. References given at [1] would be helpful. [1] http://selenium-tutorial.blogspot.com/2014/03/webdriver-wait-for-page-load.html Thanks, Krishantha. Thanks! - Ayesha On Fri, Oct 17, 2014 at 10:10 AM, Sohani Weerasinghe soh...@wso2.com 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? 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 Dev@wso2.org 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.comsa=Dsntz=1usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg 20, Palmgrove Avenue, Colombo 3 E-Mail: aye...@wso2.com ayshsa...@gmail.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Krishantha Samaraweera Senior Technical Lead - Test Automation Mobile: +94 77 7759918 WSO2, Inc.; http://wso2.com/ lean . enterprise . middlewear. ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Reduce the execution speed of Web Driver
Hi Krishantha, In order to avoid thread sleeps inside ui-test cases, I have written an extension[01] for the automation framework which waits test execution until assets are populated properly after completing indexing and all. This applies for some other tests(ex: REST APIs) other than ui-test cases as well. With that I do not need to wait test cases unless specific cases. For specific cases where wait is needed We'll implement our own wait functions where ever possible. WDYT? [01] https://docs.wso2.com/display/TA430/TestNG+Listeners Thanks! - Ayesha On Thu, Oct 23, 2014 at 6:06 AM, Krishantha Samaraweera krishan...@wso2.com wrote: Hi, On Mon, Oct 20, 2014 at 10:25 AM, Ayesha Dissanayaka aye...@wso2.com 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. Never use thread sleeps for waits unless it is really required and no any other way to achieve page waits. You need to write your own wait function based on the elements you are expecting to be visible in next step. References given at [1] would be helpful. [1] http://selenium-tutorial.blogspot.com/2014/03/webdriver-wait-for-page-load.html Thanks, Krishantha. Thanks! - Ayesha On Fri, Oct 17, 2014 at 10:10 AM, Sohani Weerasinghe soh...@wso2.com 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? 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 Dev@wso2.org 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.comsa=Dsntz=1usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg 20, Palmgrove Avenue, Colombo 3 E-Mail: aye...@wso2.com ayshsa...@gmail.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Krishantha Samaraweera Senior Technical Lead - Test Automation Mobile: +94 77 7759918 WSO2, Inc.; http://wso2.com/ lean . enterprise . middlewear. -- *Ayesha Dissanayaka* Software Engineer, WSO2, Inc : http://wso2.com http://www.google.com/url?q=http%3A%2F%2Fwso2.comsa=Dsntz=1usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg 20, Palmgrove Avenue, Colombo 3 E-Mail: aye...@wso2.com ayshsa...@gmail.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Reduce the execution speed of Web Driver
On Thu, Oct 23, 2014 at 10:03 AM, Ayesha Dissanayaka aye...@wso2.com wrote: Hi Krishantha, In order to avoid thread sleeps inside ui-test cases, I have written an extension[01] for the automation framework which waits test execution until assets are populated properly after completing indexing and all. This applies for some other tests(ex: REST APIs) other than ui-test cases as well. With that I do not need to wait test cases unless specific cases. For specific cases where wait is needed We'll implement our own wait functions where ever possible. WDYT? +1 would like to go though the new extension during the code review schedule in next week. May be we can make it a common extension and reuse it for all products. Thanks, Krishantha. [01] https://docs.wso2.com/display/TA430/TestNG+Listeners Thanks! - Ayesha On Thu, Oct 23, 2014 at 6:06 AM, Krishantha Samaraweera krishan...@wso2.com wrote: Hi, On Mon, Oct 20, 2014 at 10:25 AM, Ayesha Dissanayaka aye...@wso2.com 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. Never use thread sleeps for waits unless it is really required and no any other way to achieve page waits. You need to write your own wait function based on the elements you are expecting to be visible in next step. References given at [1] would be helpful. [1] http://selenium-tutorial.blogspot.com/2014/03/webdriver-wait-for-page-load.html Thanks, Krishantha. Thanks! - Ayesha On Fri, Oct 17, 2014 at 10:10 AM, Sohani Weerasinghe soh...@wso2.com 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? 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 Dev@wso2.org 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.comsa=Dsntz=1usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg 20, Palmgrove Avenue, Colombo 3 E-Mail: aye...@wso2.com ayshsa...@gmail.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Krishantha Samaraweera Senior Technical Lead - Test Automation Mobile: +94 77 7759918 WSO2, Inc.; http://wso2.com/ lean . enterprise . middlewear. -- *Ayesha Dissanayaka* Software Engineer, WSO2, Inc : http://wso2.com http://www.google.com/url?q=http%3A%2F%2Fwso2.comsa=Dsntz=1usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg 20, Palmgrove Avenue, Colombo 3 E-Mail: aye...@wso2.com ayshsa...@gmail.com -- Krishantha Samaraweera Senior Technical Lead - Test Automation Mobile: +94 77 7759918 WSO2, Inc.; http://wso2.com/ lean . enterprise . middlewear. ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Reduce the execution speed of Web Driver
On Mon, Oct 20, 2014 at 4:55 AM, Ayesha Dissanayaka aye...@wso2.com 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 soh...@wso2.com 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 Dev@wso2.org 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.comsa=Dsntz=1usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg 20, Palmgrove Avenue, Colombo 3 E-Mail: aye...@wso2.com ayshsa...@gmail.com ___ Dev mailing list Dev@wso2.org 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 Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Reduce the execution speed of Web Driver
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 soh...@wso2.com 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? 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 Dev@wso2.org 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.comsa=Dsntz=1usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg 20, Palmgrove Avenue, Colombo 3 E-Mail: aye...@wso2.com ayshsa...@gmail.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
[Dev] Reduce the execution speed of Web Driver
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? 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 Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev