Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99407

Element always returning null despite having an ID on the page

$
0
0
<div id="parent">
<div id="content-wrap">
<div id="content" class="clearfix">                
<!-- 2019.1.215.45 -->
<div id="content-main-admin">
<div class="clearfix">
<div class="clearfix">
<div class="content-right">
<h1>Working Shift Manager
</h1>
<p>
Please find below all of your working shifts for administration.
</p>
</div>
</div>
<div class="clearfix">
<div class="content-right">
<div id="ctl00_cphContent_litAdminButtons" class="admin-buttons clearfix" 
style="margin: 0 0 20px 0">
<a href="working-shift-admin.aspx" class="button add" id="btnAdd" 
onclick="doSpinnerStart()">
Add New</a>

Unable to click the id element btnAdd

public IWebElement AddNewButton { get { return FindByID("btnAdd"); } 

Element is returned as null when trying to read it from the html, my code compares the value above against the value in the html if they match it clicks the add button. In this case a null is returned and button isn't clicked


Viewing all articles
Browse latest Browse all 99407

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>