Need help selecting element by Name in selenium, element cannot be found

  html, python, selenium

Need help using selenium, I am trying to target a button in this left nav by name but it is not selecting it driver.find_element_by_name(‘QuotationLink_SinglePage’).click()

<aside columnwidth="2" content="leftnav" data-role="page-left-panel" partialcontainer="" role="complementary" wmleftpanel="" wmsmoothscroll="false" widget-id="widget-id76" class="app-left-panel left-panel-collapsed slide-in col-md-2 col-sm-2 col-xs-10" name="leftpanel"><app-partial-leftnav><section data-role="partial" role="region" type="leftnav" wmpartial="" widget-id="widget-id189" class="app-partial clearfix" name="leftnav"><!----><!----><ul data-element-type="wmNav" data-role="page-header" layout="stacked" type="pills" wmnav="" widget-id="widget-id190" class="nav app-nav nav-pills nav-stacked" name="leftnavigation"><!----><!----><!----><!----><li role="presentation" wmnavitem="" widget-id="widget-id191" class="app-nav-item" name="list_dashboard"><!----><a caption="Dashboard" click.event="Actions.goToPage_Dashboard.invoke()" data-identifier="anchor" iconclass="wi wi-dashboard" paddingbottom="10px" role="link" wmanchor="" widget-id="widget-id198" target="_self" class="app-anchor active" name="dashboardLink" href="javascript:void(0)" tabindex="0" style="padding-bottom: 10px;"><!----><!----><i aria-hidden="true" class="app-icon wi wi-dashboard"></i><!----><span class="sr-only">Dashboard Icon</span><span class="anchor-caption">Dashboard</span><!----></a><!----></li><li role="presentation" wmnavitem="" widget-id="widget-id192" class="app-nav-item" name="nav_item5"><!----><a caption="Quotation" click.event="Actions.goToPage_Quotation_List.invoke()" data-identifier="anchor" iconclass="fa fa-ticket" paddingbottom="10px" paddingtop="10px" role="link" show.bind="Variables.SinglePageQot.firstRecord.description == 'No'" wmanchor="" widget-id="widget-id199" hidden="" target="_self" class="app-anchor" name="QuotationLink" href="javascript:void(0)" tabindex="0" style="padding-bottom: 10px; padding-top: 10px;"><!----><!----><i aria-hidden="true" class="app-icon fa fa-ticket"></i><!----><span class="sr-only">Quotation Icon</span><span class="anchor-caption">Quotation</span><!----></a><!----><a caption="Quotation" click.event="Actions.goToPage_Quotation_List_v1.invoke()" data-identifier="anchor" iconclass="fa fa-ticket" paddingbottom="10px" paddingtop="10px" role="link" show.bind="Variables.SinglePageQot.firstRecord.description == 'Yes'" wmanchor="" widget-id="widget-id200" target="_self" class="app-anchor" name="QuotationLink_SinglePage" href="javascript:void(0)" tabindex="0" style="padding-bottom: 10px; padding-top: 10px;"><!----><!----><i aria-hidden="true" class="app-icon fa fa-ticket"></i><!----><span class="sr-only">Quotation Icon</span><span class="anchor-caption">Quotation</span><!----></a></li><li role="presentation" show="false" wmnavitem="" widget-id="widget-id193" hidden="" class="app-nav-item" name="list_inventory"><a caption="Products" click.event="Actions.goToPage_dynamicForm.invoke()" data-identifier="anchor" iconclass="fa fa-cubes" role="link" show.bind="Variables.productsFlag.dataSet.value" wmanchor="" widget-id="widget-id194" hidden="" target="_self" class="app-anchor" name="inventoryLink" href="javascript:void(0)" tabindex="0"><!----><!----><i aria-hidden="true" class="app-icon fa fa-cubes"></i><!----><span class="sr-only">Products Icon</span><span class="anchor-caption">Products</span><!----></a></li><li role="presentation" show="true" wmnavitem="" widget-id="widget-id195" class="app-nav-item" name="list_dashboard"><!----><a caption="Report" click.event="Actions.goToPage_Dynamic_Form.invoke()" data-identifier="anchor" iconclass="wi wi-assessment" paddingbottom="10px" paddingtop="10px" role="link" show="true" wmanchor="" widget-id="widget-id201" target="_self" class="app-anchor" name="ReportLink" href="javascript:void(0)" tabindex="0" style="padding-bottom: 10px; padding-top: 10px;"><!----><!----><i aria-hidden="true" class="app-icon wi wi-assessment"></i><!----><span class="sr-only">Report Icon</span><span class="anchor-caption">Report</span><!----></a></li><li role="presentation" show="false" wmnavitem="" widget-id="widget-id196" hidden="" class="app-nav-item" name="nav_item6"><!----><a caption="UnderWriter Maintenance" click.event="Actions.goToPage_Underwriter_maintenance.invoke()" data-identifier="anchor" iconclass="wi wi-settings-input-component" role="link" wmanchor="" widget-id="widget-id202" target="_self" class="app-anchor" name="UWLink" href="javascript:void(0)" tabindex="0"><!----><!----><i aria-hidden="true" class="app-icon wi wi-settings-input-component"></i><!----><span class="sr-only">UnderWriter Maintenance Icon</span><span class="anchor-caption">UnderWriter Maintenance</span><!----></a></li><li role="presentation" wmnavitem="" widget-id="widget-id197" class="app-nav-item" name="nav_dropDownItem"><!----><div autoclose="disabled" autoopen="activepage" caption="Settings" dataset.bind="Variables.SVMenuNavigation.dataSet" datasource.bind="Variables.SVMenuNavigation" dropdown="" iconclass="wi wi-settings" itemicon="icon" itemlabel="label" itemlink="link" menuclass="btn-link" menulayout="vertical" menuposition="inline" paddingtop="10px" wmmenu="" widget-id="widget-id203" class="dropdown app-menu" name="menu1" title=""><!----><!----><!----><button aria-haspopup="true" caption.bind="caption" dropdowntoggle="" hint.bind="hint" iconclass.bind="iconclass" iconposition.bind="iconposition" shortcutkey.bind="shortcutkey" tabindex.bind="tabindex" wmbutton="" widget-id="widget-id204" class="btn app-button dropdown-toggle btn-link" type="undefined" tabindex="0" icon-position="left" title="" style="padding-top: 10px;"><!----><!----><i aria-hidden="true" class="app-icon wi wi-settings"></i><!----><span class="sr-only">Settings Icon</span><span class="btn-caption">Settings</span><span class="pull-right caret fa fa-caret-down"></span><!----></button><!----></div><!----></li><!----></ul></section></app-partial-leftnav></aside>

Source: Python Questions

LEAVE A COMMENT