</head>
<body>
<div class="">
<div class="base-wrapper ">
<div class="base-main">
<div role="main" class="base-body">
<form action="/frame/prompt" method="post" id="login-form" class="inline login-form hidden">
<input type="hidden" name="sid" value="ZjUwNzUzYjA4MjVkNDc4OGJkODUyZThjOTVhMzM3ZTA=|70.181.192.163|1610702974|3040365d5035c5288c02b1c5abd3bb6bae523af0">
<input type="hidden" name="url" value="/frame/prompt">
<input type="hidden" name="enrollment_message" value="">
<input type="hidden" name="itype" value="adfs">
<input type="hidden" name="ukey" value="DUOF1NY48TBKCWXBRTRF">
<input type="hidden" name="out_of_date" value="">
<input type="hidden" name="days_out_of_date" value="">
<input type="hidden" name="should_update_dm" value="">
<input type="hidden" name="preferred_factor" value="">
<input type="hidden" name="preferred_device" value="">
<input type="hidden" name="days_to_block" value="None">
<input type="hidden" name="should_retry_u2f_timeouts" value="False">
<input type="hidden" id="has_phone_that_requires_compliance_text" name="has_phone_that_requires_compliance_text" value="False">
<fieldset class="device-selector hidden">
<h1 class="cramped-frame-view">
Device:
</h1>
<div class="device-select-wrapper">
<select name="device" aria-label="Device" tabindex=2>
<option value="phone1">iOS (XXX-XXX-5065)</option>
</select>
</div>
</fieldset>
<div id="auth_methods">
<fieldset data-device-index="phone1" class="hidden">
<h2 class="medium-or-larger auth-method-header">
Choose an authentication method
</h2>
<div class="row-label push-label">
<input type="hidden" name="factor" value="Duo Push">
<span class="label factor-label">
<i class="icon-smartphone-check"></i>
Duo Push
<small class="recommended">
Recommended
</small>
</span>
<button type="submit" class="auth-button positive" tabindex="2" ><!-- -->Send Me a Push </button>
</div>
<div class="passcode-label row-label">
<input type="hidden" name="factor" value="Passcode">
<span class="label factor-label">
<i class="icon-smartphone-ellipsis" alt="" role="presentation"></i>
Passcode
</span>
<div class="passcode-input-wrapper">
<input type="text" name="passcode" autocomplete="off" data-index="phone1" class="hidden passcode-input" placeholder="ex. 867539" aria-label="passcode" tabindex=2>
<div class="next-passcode-msg" role="alert" aria-live="polite"></div>
</div>
<button type="submit" class="auth-button positive" id="passcode" tabindex="2" ><!-- -->Enter a Passcode </button>
<input name="phone-smsable" type="hidden" value="False" />
<input name="mobile-otpable" type="hidden" value="True" />
<input name="next-passcode" type="hidden" value="None" />
</div>
</fieldset>
<input type="hidden" name="has-token" value="false">
</div>
<div>
</div>
</form>
</div>
</div>
<div class="base-navigation">
<div class="base-navigation">
<div role="banner">
<a href="/frame/prompt?sid=ZjUwNzUzYjA4MjVkNDc4OGJkODUyZThjOTVhMzM3ZTA=|70.181.192.163|1610702974|3040365d5035c5288c02b1c5abd3bb6bae523af0">
<img src="/frame/logo?sid=ZjUwNzUzYjA4MjVkNDc4OGJkODUyZThjOTVhMzM3ZTA=|70.181.192.163|1610702974|3040365d5035c5288c02b1c5abd3bb6bae523af0" alt="CSUSM Authentication" width="128"/>
</a>
</div>
<div class="help-sidebar">
<button class='btn btn-support'>
<i class="icon-align-justify" aria-label="Open"></i>
<i class="icon-delete" aria-label="Close"></i>
Settings
</button>
<div class="help-links">
<nav role="navigation">
<a id="help_link" class="help-nav" href="https://guide.duo.com/prompt" target="_blank" aria-label="What is the Duo Prompt? (Opens in a new tab.)">
What is this?<i class="icon-new-window"></i>
</a>
<a class="help-nav" id="new-device" href="/frame/enroll/pre_flow_prompt?sid=ZjUwNzUzYjA4MjVkNDc4OGJkODUyZThjOTVhMzM3ZTA%3D%7C70.181.192.163%7C1610702974%7C3040365d5035c5288c02b1c5abd3bb6bae523af0&post_auth_action=addDevice">
Add a new device
</a>
<a class="help-nav" href="/frame/enroll/pre_flow_prompt?sid=ZjUwNzUzYjA4MjVkNDc4OGJkODUyZThjOTVhMzM3ZTA%3D%7C70.181.192.163%7C1610702974%7C3040365d5035c5288c02b1c5abd3bb6bae523af0&post_auth_action=manageDevices">
My Settings & Devices
</a>
<a href="#" class="need-help">Need help?</a>
</nav>
<div role="contentinfo">
<a href="https://duo.com" class="branding-link" target="_blank">
Powered by Duo Security
</a>
</div>
</div>
</div>
<div class="help-overlay offscreen">
<div class="help-links">
<nav role="navigation">
<a id="help_link" class="help-nav" href="https://guide.duo.com/prompt" target="_blank" aria-label="What is the Duo Prompt? (Opens in a new tab.)">
What is this?<i class="icon-new-window"></i>
</a>
<a class="help-nav" id="new-device" href="/frame/enroll/pre_flow_prompt?sid=ZjUwNzUzYjA4MjVkNDc4OGJkODUyZThjOTVhMzM3ZTA%3D%7C70.181.192.163%7C1610702974%7C3040365d5035c5288c02b1c5abd3bb6bae523af0&post_auth_action=addDevice">
Add a new device
</a>
<a class="help-nav" href="/frame/enroll/pre_flow_prompt?sid=ZjUwNzUzYjA4MjVkNDc4OGJkODUyZThjOTVhMzM3ZTA%3D%7C70.181.192.163%7C1610702974%7C3040365d5035c5288c02b1c5abd3bb6bae523af0&post_auth_action=manageDevices">
My Settings & Devices
</a>
<a href="#" class="need-help">Need help?</a>
</nav>
<div role="contentinfo">
<a href="https://duo.com" class="branding-link" target="_blank">
Powered by Duo Security
</a>
</div>
</div>
</div>
</div>
</div>
<div class="base-sidebar">
</div>
<div id="messages-view" class="hidden">
<div class="messages-list">
</div>
</div>
</div>
</div>
<script id="translations" type="text/json">
{"domain": "js-messages", "locale_data": {"js-messages": {"": {"domain": "js-messages", "plural_forms": "nplurals=2; plural=(n != 1);", "lang": "en"}}}}
</script>
<script src="/frame/static/shared/lib/jquery/jquery-prologue.js?v=400dc"></script>
<script src="/frame/static/shared/lib/jquery/jquery-legacy.min.js?v=72e7b"></script>
<script src="/frame/static/shared/lib/he/he.min.js?v=aaa33"></script>
<script src="/frame/static/js/lib/jquery-postmessage.min.js?v=98c73"></script>
<script src="/frame/static/shared/lib/lodash/lodash.min.js?v=14516"></script>
<script src="/frame/static/shared/lib/backbone/backbone-min.js?v=28a93"></script>
<script src="/frame/static/js/page/v3/frame.js?v=82022"></script>
<script src="/frame/static/js/page/v3/base.js?v=d6293"></script>
<script src="/frame/static/shared/lib/validator/validator.min.js?v=9a068"></script>
<script src="/frame/static/shared/lib/jquery/jquery-epilogue.js?v=c4ac5"></script>
<script id="browser_exceptions" src="/frame/static/shared/js/errors.js?v=96827" data-url="/frame/browser_exceptions"></script>
<input type="hidden" name="helpdesk-message" id="helpdesk-message" value="Please visit https://www.csusm.edu/iits/iitsforyou/multifactor-authentication/index.html for videos and guides for faculty, staff, and students." />
<!--[if lt IE 10]>
<script src="/frame/static/js/page/v3/quirks.js?v=1ed89"></script>
<!--<![endif]-->
<script src="/frame/static/js/lib/jquery.tipsy.js?v=c0432"></script>
<script src="/frame/static/js/page/v3/prompt.js?v=3f751"></script>
<!--[if lt IE 9]>
<script src="/frame/static/js/lib/html5shiv.js?v=86fbf"></script>
<![endif]-->
</body>
</html>
I'm trying to click the button on the line
<button type="submit" class="auth-button positive" tabindex="2" ><!-- -->Send Me a Push </button>
What I have tried so far:
iframe = driver.find_element_by_xpath("//iframe[@id='duo_iframe']")
driver.switch_to.frame(iframe)
then the following
driver.find_element_by_css_selector(".row-label").click()
or
driver.find_element_by_xpath("//div[@class='row-labeldiv.row-label:nth-child(2)']/button[.='Send Me a Push']").click()
or
driver.find_element_by_xpath("//button[text()='Send Me a Push']").click()
No matter what I try, selenium cannot find the element. I'm not sure what I'm missing. I know the button I am trying to click doesn't have a unique class. The most obvious solution I found on stackoverflow was using the text inside the button to click it, however even after switching to the correct iframe(?), I still cannot find the element.
I assume I switched to the iframe correctly given after inspecting element on chrome and finding
<iframe id="duo_iframe" src="https://api-b22f1fa2.duosecurity.com/frame/web/v1/auth?tx=TX|Y3N1c21cY2Fub24wMTB8RElBWlU2VzJCOUFRTExEQ1pCWDZ8MTYxMDcwMzI0MA==|883b56e2b24048e526a973c70d5bdb359db905d1&parent=https%3A%2F%2Fauth.csusm.edu%2Fadfs%2Fls%2F%3FSAMLRequest%3DnZJBTwIxEIX%252Fyqb3pbtdINAACUqMJKhE0IMXM3QHabJt105r9N%252B77GpEDxw8NZ2Z7%252BXNy0wITFXLeQwHe4%252BvESkk76ayJNvGlEVvpQPSJC0YJBmU3MxvVlL0Mll7F5xyFTtBzhNAhD5oZ1myXEzZ804MxkIVGYwFCiXyYTYY9%252FvjkdrtixyGxWgIOOoXwzxjySN6asgpa4QanCji0lIAG5pSJvI0y9N8sM0KKYTM8ieWLJpttIXQUocQapKcQ7NqT1Ek08Mycij3xCviLJl%252Fe7t0lqJBv0H%252FphU%252B3K9%252BaKVOWNKmrvC4NTeujBX26kPN2z91r0hBUVstcQ%252BxCinVLFl%252F5Xahbanty%252FnIdt0Qyevtdp2u7zZbNpsctWUbgZ%252F9w5rBACUE%252BONswk91J91p3DaOlou1q7T6SK6cNxDOGz5WdJnu21EZPFjSaAPjs07%252F97XNPgE%253D%26RelayState%3Dhttps%253A%252F%252Fcc.csusm.edu%252Fauth%252Fsaml%252Findex.php%26SigAlg%3Dhttp%253A%252F%252Fwww.w3.org%252F2001%252F04%252Fxmldsig-more%2523rsa-sha256%26Signature%3DWAdtwVP3PFqkG5AOq0gspZJPT06j6VOrKiK1p3RqsMWqug7xj4NZaHLf4ZAkhLoFdw0kIsV7EAWxi1KHRGi0AvUGoyue5EeEo6TqEuzHDBLOITdLR0xIvCjbmlXT0KfAsX1f2Vrm0tn4FPH7VETu%252BpjKQDM15TwPkfdGAWs5Eqr2ZzA9GDI5Lwg9GNakWpBqNvhC0gQ5gDiPKxigGvyLw1V5xFSOQqn4Xx5uUDvSUezAFPxB6yq72a5e0NzTmc%252FVRRliiqAjH4xMRagTgdOOruXIwBPBFlUmzy8ySChKAGjAOuXgq8uz0vEjDuYcSd%252F7A0IrBrN5GLVVrqTiqKxoSA%253D%253D&v=2.6" frameborder="0"></iframe>
encapsulating the buttons I'm trying to press and selenium finding and switching too it.