I am having trouble with clicking a within a modal using and C#.

The button is for a photo upload, and for some reason the element that is select-able (tested with JS in the console) is set to display:none and hidden behind a button. Because it is set to display:none, Selenium appears to not be able to “see” it.

Right now it is not feasible to change the markup, but I would really like to be able to complete this test. I was hoping someone had a workaround that they could share? Here is the markup:

<div id="uploadPhoto">
<div id="uploadifive-file_upload" class="uploadifive-button btn" style="height: 30px; line-height: 30px; overflow: hidden; position: relative; text-align: center; width: 100px;">
<i class="icon-plus"></i>Upload Photo<input id="file_upload" name="file_upload" style="display: none;" type="file">
<input style="font-size: 30px; opacity: 0; position: absolute; right: -3px; top: -3px; z-index: 999;" accept="image/*" type="file"></div>
<div id="uploadifive-file_upload-queue" class="uploadifive-queue"></div>
</div>



Source link https://sqa.stackexchange.com/questions/34673/-to--button-with-selenium-webdriver-using-c

LEAVE A REPLY

Please enter your comment!
Please enter your name here