我想用Java中的Selenium Web驅動程序訪問模型對話框(在Bootstrap中開發),我無法這樣做。在這裏,我要訪問標題,內容和按鈕。如何訪問使用Selenium Web驅動程序和Java在Bootstrap中開發的模型對話框內容
還有一點是xPath是動態的,每次xPath產生的方式不同。我知道可以通過部分匹配xPath來解決。
所以幫我解決這個問題。在這裏,我附上了我的模型箱設計的圖像。
這裏是代碼片段
這裏是代碼
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<div class="bootstrap-dialog-header">
<div class="bootstrap-dialog-close-button" style="display: none;">
<button class="close">
×
</button>
</div>
<div class="bootstrap-dialog-title" id="5f663313-d82d-4ab8-9712-6665e80a3654_title">
Member Registration
</div>
</div>
</div>
<div class="modal-body">
<div class="bootstrap-dialog-body">
<div class="bootstrap-dialog-message">
Sample Message Sample Message Sample Message Sample Message Sample Message Sample Message.
</div>
</div>
</div>
<div class="modal-footer">
<div class="bootstrap-dialog-footer">
<div class="bootstrap-dialog-footer-buttons">
<button class="btn btn-primary" id="353ab962-44d3-497f-8318-6db703b460d8">
Ok
</button>
</div>
</div>
</div>
</div>
</div>
什麼是bootstrap版本?什麼是引導組件名稱?提供應用程序鏈接或示例html代碼,以及到目前爲止您嘗試過了什麼? – Madhan
檢查附加屏幕截圖代碼@Madhan – Nikunj
@Nikunj如果你真的想要一個解決方案,你需要提供HTML代碼而不是屏幕截圖和硒代碼,你也試過了嗎? –