Selenium:是否有办法检查文本是否超出元素的边界?

0 人关注

我在写python+selenium的测试,这里是我偶然发现的问题。 我需要检查一个盒子里的文本是否正确显示,是否超出了边距。 我的意思是。

页面来源。

<div class="mt-5">
            <div class="row flex-column flex-lg-row">
                <div id="card-6e64c570-f558-47c8-d66a-08d9a43db45b" class="events-left-block w-100 col-lg-6 mb-4xl position-relative">
                    <a href="/Invite/Trainings/6e64c570-f558-47c8-d66a-08d9a43db45b?back=%2FCatalog" class="w-100">
                        <div class="card border-0 bg-white h-100 shadow rounded-lg p-0">
                            <div class="card-body p-4 h-100 d-flex flex-column">
                                <div class="card-title text-dark mb-4 row justify-content-between no-gutters flex-nowrap">
                                    <h5 class="mb-0">Pneumonoultramicroscopicsilicovolcanoconiosis</h5>
                                    <span class="text-white ml-4"></span>
                                <div class="card-text d-flex justify-content-between align-items-end flex-row flex-grow-1">
                                    <ui class="list-group-flush">
                                        <li class="d-flex align-items-center small list-group-item li-info text-dark">
                                            <i class="fas fa-user-friends text-light-gray fa-small"></i>
                                        <li class="d-flex align-items-center list-group-item small li-info text-dark">
                                            <i class="ri-calendar-fill text-light-gray small"></i>
                                            29.11.2021
                                    <img class="rounded-circle cover-image" src="/images/default-training.png" width="64" height="64" alt="img">