angularjs - Selenium WebDriver -cannot switch focus to modal dialog window -
screenshotthe scenario trying fire sendkeys modal dialog box, webdriver unable switch focus onto dialog box. i've tried variety of wait conditions , switch conditions without being successful
here html code
new
<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 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">
any help/corrections/suggestions hugely appreciated
the element trying target id='txtcampaignsearch'
i using visual studio (ide) & webdriver
bootstrap creating modal javascript , css, not creating a new window have switch between, question implies.
the real problem using "input-group-addon" blocks webdriver accessing input field reason, problem have run well.
waiting modal animation finish should have before clearing , sending keys txtcampaignsearch.
i had similar problem input-group-addon , solved using javascript. try this:
javascriptexecutor js = (javascriptexecutor)driver; // later on... js.executescript("document.getelementbyid('txtcampaignsearch').value = 'something';");
Comments
Post a Comment