简体   繁体   中英

How to activate loader page while running selenium code in python

I am creating a python flask web application with selenium in the backed I want to disable my webpage when the selenium driver is running to prevent user activity

I am using this code

<div id="disabler">
    <div class="text-center">
        <img src="{{url_for('static', filename='images/disabler.gif')}}">
        <p id="preloader-text">Running Automated Test</p>
    </div>
</div>

<script>
    function loader(){
        $(document).ready(function(){
            $("#disabler").fadeOut()
        });
    }
</script>

When you are using new tab every time then it is not possible to hide. You can just put always on top feature for chosen window.

You can use a predefined jQuery UI called jQuery Block UI

Or simply add a division that will block the body and will fade out when the body is loaded.

<div id="div">
    <h1>Please Wait..</h1>
</div>

jQuery will be:

$(document).ready(function(){
    $("#div").fadeOut()
  });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM