I am confused a lot here. i am unable to click on a button. Maybe it is on different frame. But as i tried to use switch statement i got an error that no such frame found. And if i directly run my code by clicking on the button them i get's an error:- Unable to locate element: //*[@id='dutch_popupBtn']
The HTML is:-
<div class="horiZontalScroll">
<table class="table highlight makeGapTable buyerTable setHeightThTd scrollTableRow">
<thead>
<tr class="auctionTable prodActName">
<th class="active_purchase"><strong>Product</strong> <small>Auction</small></th>
<th class="active_purchase"><strong>Volume</strong><small>ID number</small></th>
<th class="active_purchase"><strong>Starting Price</strong> <small>Minimum Price</small></th>
<th class="active_purchase"><strong>Bids</strong> <small>Current Price</small> </th>
<!--<th><strong>Bids/Bidders</strong></th>-->
<th class="active_purchase"><strong>Duration</strong></th>
<th class="active_purchase"><strong>Action</strong></th>
</tr>
</thead>
<tbody id="active_auctions" class="mCustomScrollbar _mCS_3 mCS_no_scrollbar">
<div id="mCSB_3" class="mCustomScrollBox mCS-light mCSB_vertical mCSB_inside" tabindex="0">
<div id="mCSB_3_container" class="mCSB_container mCS_y_hidden mCS_no_scrollbar_y" style="position:relative; top:0; left:0;" dir="ltr">
<tr class="auctionTable rowHref prodActName" style="cursor: pointer;" id="auctionlistrow621" href="/buyer/auction/auctiondetail/id/621">
<td class="active_purchase">
<strong>360A iodide</strong>
<small style="font-size: 75%;">Dutch Auction</small>
</td>
<td class="active_purchase"> 12.000 fl oz <small style="font-size: 75%;">ID 621</small>
</td>
<td class="active_purchase"> 10.000 EUR/fl oz
<small>100 EUR/fl oz</small>
</td>
<td class="active_purchase">
<small class="">9.600 EUR/fl oz</small>
</td>
<td class="active_purchase">
<span class="duration_left" data-id="621" data-bind="11d 20h 8m <br></span>">11d 20h 8m
<br>
</span> <small>10.05.2018 22:10:54</small>
</td>
<td class="active_purchase actionIcons">
<a title="Place Bid" href="javascript:void(0)" id="dutch_popupBtn" data-bind="621"><i class="fa fa-gavel" noredirect="1"></i></a>
<i title="Remove Auction" class="fa fa-remove no auctionDeleteBtnClass" data-bind="621" noredirect="1"></i>
<a title="Contact Seller" href="javascript:void(0)" id="requestQues" data-params="{"userid":"343","name":"Beta Zero","company":"Clavax Zer0","membership":"4","companyrevenue":""}" data-auction="621"><i class="fa fa-envelope no" noredirect="1"></i></a>
<a title="Click to learn more" href="javascript:void(0);" data="dutch" class="tour_popupBtn" noredirect="1"><i class="fa fa-exclamation-circle" noredirect="1"></i></a>
</td>
</tr>
<tr class="auctionTable rowHref prodActName" style="cursor: pointer;" id="auctionlistrow615" href="/buyer/auction/auctiondetail/id/615">
<td class="active_purchase">
<strong>360A iodide</strong>
<small style="font-size: 75%;">Dutch Auction</small>
</td>
<td class="active_purchase"> 12.000 Liter <small style="font-size: 75%;">ID 615</small>
</td>
<td class="active_purchase"> 5.000 USD/Liter
<small>1.000 USD/Liter</small>
</td>
<td class="active_purchase">
<small class="">4.900 USD/Liter</small>
</td>
<td class="active_purchase">
<span class="duration_left" data-id="615" data-bind="4d 18h 40m <br></span>">4d 18h 40m
<br>
</span> <small>03.05.2018 20:42:57</small>
</td>
<td class="active_purchase actionIcons">
<a title="Place Bid" href="javascript:void(0)" id="dutch_popupBtn" data-bind="615"><i class="fa fa-gavel" noredirect="1"></i></a>
<i title="Remove Auction" class="fa fa-remove no auctionDeleteBtnClass" data-bind="615" noredirect="1"></i>
<a title="Contact Seller" href="javascript:void(0)" id="requestQues" data-params="{"userid":"343","name":"Beta Zero","company":"Clavax Zer0","membership":"4","companyrevenue":""}" data-auction="615"><i class="fa fa-envelope no" noredirect="1"></i></a>
<a title="Click to learn more" href="javascript:void(0);" data="dutch" class="tour_popupBtn" noredirect="1"><i class="fa fa-exclamation-circle" noredirect="1"></i></a>
</td>
</tr>
</div>
<div id="mCSB_3_scrollbar_vertical" class="mCSB_scrollTools mCSB_3_scrollbar mCS-light mCSB_scrollTools_vertical" style="display: none;">
<div class="mCSB_draggerContainer">
<div id="mCSB_3_dragger_vertical" class="mCSB_dragger" style="position: absolute; min-height: 30px; height: 0px; top: 0px;" oncontextmenu="return false;">
<div class="mCSB_dragger_bar" style="line-height: 30px;"></div>
</div>
<div class="mCSB_draggerRail"></div>
</div>
</div>
</div>
</tbody>
</table>
</div>
My code is :-
//driver.switchTo().frame("active_auctions");
driver.findElement(By.xpath("//*[@id='dutch_popupBtn']")).click();
System.out.println("test");
The Error is :-
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: //*[@id='dutch_popupBtn']
Can anyone help me in clicking on the Place bid button. It would be very helpful.