screenshot這種情況是,我試圖將sendkeys引入模態對話框,但webdriver無法將焦點切換到對話框。我已經試過各種等待條件和切換條件沒有被成功Selenium WebDriver - 無法將焦點切換到模態對話框窗口
下面是HTML代碼
新
<div class="row">
<ul class="nav nav-tabs">
<li role="presentation" class="active"><a data-toggle="tab" href="#ModalAddCampaignsSearchTab">Search</a></li>
<li role="presentation"><a data-toggle="tab" href="#ModalAddCampaignsToAddTab">New ({{DealerFactory.Campaign.NumberOfCampaignsToAdd()}})</a></li>
</ul>
<div class="tab-content">
<div id="ModalAddCampaignsSearchTab" class="tab-pane fade in active">
<br/>
<div class="col-lg-12">
<label for="Select_A_Campaign">Select A Campaign</label>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-search" id="icoSearch"></i>
<i class="fa fa-spinner fa-pulse" id="icoSearching" style="display: none;"></i>
</div>
<input class="form-control" id="txtCampaignSearch" name="txtCampaignSearch" ng-change="findDealersToAdd()" ng-model="DealerFactory.Campaign.searchCampaigns.searchTerm" placeholder="Search" type="text" value="" />
</div>
</div>
<div id="divCampaignSearchModalResults" class="well" ng-show="DealerFactory.Campaign.searchCampaigns.campaigns.length>0" >
<div class="row">
<div class="col-lg-12 text-right">
<p>
Campaigns: {{DealerFactory.Campaign.searchCampaigns.campaigns.length}}
</p>
</div>
</div>
<div class="row">
<div class="col-lg-12">
任何幫助/更正/建議非常感謝
我努力的目標元素是ID = 'txtCampaignSearch'
我使用的Visual Studio(IDE)& webdriver的
你可以添加如何模態窗口看起來的屏幕截圖?當你試圖識別時,拋出的異常是什麼? –
它返回無法找到元素錯誤,請查找附加屏幕截圖 –
您可以檢查compaignSearch元素是否是iFrame標記的子元素嗎? –