通过Selenium以ng-repeat格式获取行和列值-(rowRenderIndex,row)在rowContainer.renderedRows中按$ index跟踪

时间:2019-02-15 17:15:24

标签: selenium selenium-webdriver katalon-studio

我正在尝试通过硒在网页上获取所有行和列的值,它建立在有角度的ng-repeat上,就像-rowContainer.renderedRows跟踪的(rowRenderIndex,row),由$ index < / strong>

我刚接触硒,不知道如何处理。 目前,我知道如何通过td / tr而不是ng-repeat从html表中获取数据。 从硒的角度浏览并没有找到相关的答案来处理此问题。请帮忙。

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.4/angular.min.js"></script>
<div role="rowgroup" class="ui-grid-viewport ng-isolate-scope" ng-style="colContainer.getViewportStyle()" ui-grid-viewport="" style="overflow: scroll;">
    <!-- tbody -->
    <div class="ui-grid-canvas">
        <!-- ngRepeat: (rowRenderIndex, row) in rowContainer.renderedRows track by $index -->
        <div ng-repeat="(rowRenderIndex, row) in rowContainer.renderedRows track by $index" class="ui-grid-row ng-scope" ng-style="Viewport.rowStyle(rowRenderIndex)" ng-class="{'ui-grid-row-selected': row.isSelected, 'ui-grid-row-focused': row.isFocused}" style="">
            <div role="row" ui-grid-row="row" row-render-index="rowRenderIndex" class="ng-isolate-scope">
                <!-- ngRepeat: (colRenderIndex, col) in colContainer.renderedColumns track by col.uid -->
                <div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell ng-scope ui-grid-disable-selection ui-grid-coluiGrid-00B3" ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }" role="gridcell" ui-grid-cell="" id="1550368370393-0-uiGrid-00B3-cell">
                    <!-- ngIf: row.entity.resourceId -->
                    <div ng-if="row.entity.resourceId" class="ng-scope">
                        <md-menu class="md-menu ng-scope _md">
                            <button class="md-button md-ink-ripple" type="button" ng-transclude="" style="margin: -3px -26px;" ng-click="$mdMenu.open($event)" aria-haspopup="true" aria-expanded="false" aria-owns="menu_container_56"> <i class="glyphicon glyphicon-folder-open ng-scope" style="color:#007AA8;font-size:15px;"></i> </button>
                            <div class="_md md-open-menu-container md-whiteframe-z2" style="display: none;" id="menu_container_56" aria-hidden="true">
                                <md-menu-content style="overflow-x: hidden;overflow-y: hidden;min-width: 150px;" width="4" ng-mouseleave="$mdMenu.close()" role="menu">
                                    <!-- ngIf: row.entity.resourceType == 'ABCD' -->
                                    <md-menu-item ng-if="row.entity.resourceType == 'ABCD' " style="min-height:28px;height:28px;" class="ng-scope">
                                        <button class="md-button md-ink-ripple" type="button" ng-transclude="" title="Activate" ng-click="grid.appScope.execActions({action : 'showMetroServiceActions', dataItem : { data: {'service-name':row.entity.resourceId,'resourceId': row.entity.resourceId,'resourceType':row.entity.resourceType}, appName:'MOWFM', selectedAction: 'Activate',subscribeChannelUrl:'http://ndashst1.test.att.com:3023', channelName :'serviceActivation',apiUrl:'/api/metro/metro_roadm_actions/RequestToActivateService'}})" role="menuitem"> <span md-menu-align-target="" class="ng-scope"><i class="glyphicon glyphicon-list-alt" style="color:#007AA8;font-size:11px;"></i>&nbsp;&nbsp;Activate</span></button>
                                    </md-menu-item>
                                    <!-- end ngIf: row.entity.resourceType == 'ABCD' -->
                                    <!-- ngIf: row.entity.resourceType == 'ABCD' -->
                                    <md-menu-divider ng-if="row.entity.resourceType == 'ABCD'" role="separator" class="ng-scope"></md-menu-divider>
                                    <!-- end ngIf: row.entity.resourceType == 'ABCD' -->
                                    <!-- ngIf: row.entity.resourceType == 'ABCD' -->
                                    <md-menu-item ng-if="row.entity.resourceType == 'ABCD'" style="min-height:28px;height:28px;" class="ng-scope">
                                        <button class="md-button md-ink-ripple" type="button" ng-transclude="" title="Deactivate" ng-click="grid.appScope.execActions({action : 'showMetroServiceActions', dataItem : { data: row.entity, apiUrl:'/api/metro/metro_roadm_actions/DeactivateService', selectedAction: 'Deactivate'}})" role="menuitem"> <span md-menu-align-target="" class="ng-scope"><i class="glyphicon glyphicon-minus-sign" style="color:#007AA8;font-size:11px;"></i>&nbsp;&nbsp;Deactivate</span></button>
                                    </md-menu-item>
                                    <!-- end ngIf: row.entity.resourceType == 'ABCD' -->
                                    <!-- ngIf: row.entity.resourceType == 'ABCD' -->
                                    <md-menu-divider ng-if="row.entity.resourceType == 'ABCD'" role="separator" class="ng-scope"></md-menu-divider>
                                    <!-- end ngIf: row.entity.resourceType == 'ABCD' -->
                                    <md-menu-item style="min-height:28px;height:28px;">
                                        <button class="md-button md-ink-ripple" type="button" ng-transclude="" title="Launch Access &amp; Maintenance" ng-click="grid.appScope.execActions({action : 'showMetroServiceActions', dataItem : { data: row.entity, selectedAction: 'Launch Access &amp; Maintenance'}})" role="menuitem"> <span md-menu-align-target="" class="ng-scope"><i class="glyphicon glyphicon-minus-sign" style="color:#007AA8;font-size:11px;"></i>&nbsp;&nbsp;Launch Access &amp; Maintenance</span></button>
                                    </md-menu-item>
                                    <md-menu-divider role="separator"></md-menu-divider>
                                    <md-menu-item style="min-height:28px;height:28px;">
                                        <button class="md-button md-ink-ripple" type="button" ng-transclude="" title="Fallout Events" ng-click="grid.appScope.execActions({action : 'launchPMModal', dataItem : { data: {'service-name':row.entity.resourceId,'resourceId': row.entity.resourceId,'resourceType':row.entity.resourceType},  selectedAction: 'Fallout Events', selectedResourceType:'Services' ,apiUrl:'/api/abframework/widgets/5b3269e5c6d26730bca88092'}})" role="menuitem"> <span md-menu-align-target="" class="ng-scope"><i class="glyphicon glyphicon-minus-sign" style="color:#007AA8;font-size:11px;"></i>&nbsp;&nbsp;Fallout Events</span></button>
                                    </md-menu-item>
                                    <md-menu-divider role="separator"></md-menu-divider>
                                    <md-menu-item style="min-height:28px;height:28px;">
                                        <button class="md-button md-ink-ripple" type="button" ng-transclude="" title="Acknowledgements" ng-click="grid.appScope.execActions({action : 'launchPMModal', dataItem : { data: {'service-name':row.entity.resourceId,'resourceId': row.entity.resourceId,'resourceType':row.entity.resourceType}, selectedAction: 'Acknowledgments', apiUrl:'/api/abframework/widgets/5b326d03c6d26730bca88093'}})" role="menuitem"> <span md-menu-align-target="" class="ng-scope"><i class="glyphicon glyphicon-minus-sign" style="color:#007AA8;font-size:11px;"></i>&nbsp;&nbsp;Acknowledgments</span></button>
                                    </md-menu-item>
                                    <md-menu-divider role="separator"></md-menu-divider>
                                    <md-menu-item style="min-height:28px;height:28px;">
                                        <button class="md-button md-ink-ripple" type="button" ng-transclude="" title="Cancel Order" ng-click="grid.appScope.execActions({action : 'showMetroServiceActions', dataItem : { data: row.entity, commonId:row.entity.subGridOptions, selectedAction: 'Cancel Order', selectedResourceType:'Services' ,apiUrl:'/api/metro/mowfm/UpdateOrder'}})" role="menuitem"> <span md-menu-align-target="" class="ng-scope"><i class="glyphicon glyphicon-minus-sign" style="color:#007AA8;font-size:11px;"></i>&nbsp;&nbsp;Cancel Order</span></button>
                                    </md-menu-item>
                                </md-menu-content>
                            </div>
                        </md-menu>
                    </div>
                    <!-- end ngIf: row.entity.resourceId -->
                </div>
                <!-- end ngRepeat: (colRenderIndex, col) in colContainer.renderedColumns track by col.uid -->
                <div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell ng-scope ui-grid-disable-selection ui-grid-coluiGrid-00B4" ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }" role="gridcell" ui-grid-cell="" id="1550368370393-0-uiGrid-00B4-cell">
                    <div class="ui-grid-cell-contents ng-binding ng-scope">ABCD</div>
                </div>
                <!-- end ngRepeat: (colRenderIndex, col) in colContainer.renderedColumns track by col.uid -->
                <div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell ng-scope ui-grid-disable-selection ui-grid-coluiGrid-00B5" ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }" role="gridcell" ui-grid-cell="" id="1550368370393-0-uiGrid-00B5-cell">
                    <div class="ui-grid-cell-contents ng-binding ng-scope">ABCD</div>
                </div>
                <!-- end ngRepeat: (colRenderIndex, col) in colContainer.renderedColumns track by col.uid -->
            </div>
            <!-- ngIf: expandableRow.shouldRenderExpand() -->
            <!-- ngIf: expandableRow.shouldRenderFiller() -->
        </div>
        <!-- end ngRepeat: (rowRenderIndex, row) in rowContainer.renderedRows track by $index -->
        <div ng-repeat="(rowRenderIndex, row) in rowContainer.renderedRows track by $index" class="ui-grid-row ng-scope" ng-style="Viewport.rowStyle(rowRenderIndex)" ng-class="{'ui-grid-row-selected': row.isSelected, 'ui-grid-row-focused': row.isFocused}">
            <div role="row" ui-grid-row="row" row-render-index="rowRenderIndex" class="ng-isolate-scope">
                <!-- ngRepeat: (colRenderIndex, col) in colContainer.renderedColumns track by col.uid -->
                <div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell ng-scope ui-grid-disable-selection ui-grid-coluiGrid-00B3" ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }" role="gridcell" ui-grid-cell="" id="1550368370393-1-uiGrid-00B3-cell">
                    <!-- ngIf: row.entity.resourceId -->
                    <div ng-if="row.entity.resourceId" class="ng-scope">
                        <md-menu class="md-menu ng-scope _md">
                            <button class="md-button md-ink-ripple" type="button" ng-transclude="" style="margin: -3px -26px;" ng-click="$mdMenu.open($event)" aria-haspopup="true" aria-expanded="false" aria-owns="menu_container_57"> <i class="glyphicon glyphicon-folder-open ng-scope" style="color:#007AA8;font-size:15px;"></i> </button>
                            <div class="_md md-open-menu-container md-whiteframe-z2" style="display: none;" id="menu_container_57" aria-hidden="true">
                                <md-menu-content style="overflow-x: hidden;overflow-y: hidden;min-width: 150px;" width="4" ng-mouseleave="$mdMenu.close()" role="menu">
                                    <!-- ngIf: row.entity.resourceType == 'ABCD' -->
                                    <!-- ngIf: row.entity.resourceType == 'ABCD' -->
                                    <!-- ngIf: row.entity.resourceType == 'ABCD' -->
                                    <!-- ngIf: row.entity.resourceType == 'ABCD' -->
                                    <md-menu-item style="min-height:28px;height:28px;">
                                        <button class="md-button md-ink-ripple" type="button" ng-transclude="" title="Launch Access &amp; Maintenance" ng-click="grid.appScope.execActions({action : 'showMetroServiceActions', dataItem : { data: row.entity, selectedAction: 'Launch Access &amp; Maintenance'}})" role="menuitem"> <span md-menu-align-target="" class="ng-scope"><i class="glyphicon glyphicon-minus-sign" style="color:#007AA8;font-size:11px;"></i>&nbsp;&nbsp;Launch Access &amp; Maintenance</span></button>
                                    </md-menu-item>
                                    <md-menu-divider role="separator"></md-menu-divider>
                                    <md-menu-item style="min-height:28px;height:28px;">
                                        <button class="md-button md-ink-ripple" type="button" ng-transclude="" title="Fallout Events" ng-click="grid.appScope.execActions({action : 'launchPMModal', dataItem : { data: {'service-name':row.entity.resourceId,'resourceId': row.entity.resourceId,'resourceType':row.entity.resourceType},  selectedAction: 'Fallout Events', selectedResourceType:'Services' ,apiUrl:'/api/abframework/widgets/5b3269e5c6d26730bca88092'}})" role="menuitem"> <span md-menu-align-target="" class="ng-scope"><i class="glyphicon glyphicon-minus-sign" style="color:#007AA8;font-size:11px;"></i>&nbsp;&nbsp;Fallout Events</span></button>
                                    </md-menu-item>
                                    <md-menu-divider role="separator"></md-menu-divider>
                                    <md-menu-item style="min-height:28px;height:28px;">
                                        <button class="md-button md-ink-ripple" type="button" ng-transclude="" title="Acknowledgements" ng-click="grid.appScope.execActions({action : 'launchPMModal', dataItem : { data: {'service-name':row.entity.resourceId,'resourceId': row.entity.resourceId,'resourceType':row.entity.resourceType}, selectedAction: 'Acknowledgments', apiUrl:'/api/abframework/widgets/5b326d03c6d26730bca88093'}})" role="menuitem"> <span md-menu-align-target="" class="ng-scope"><i class="glyphicon glyphicon-minus-sign" style="color:#007AA8;font-size:11px;"></i>&nbsp;&nbsp;Acknowledgments</span></button>
                                    </md-menu-item>
                                    <md-menu-divider role="separator"></md-menu-divider>
                                    <md-menu-item style="min-height:28px;height:28px;">
                                        <button class="md-button md-ink-ripple" type="button" ng-transclude="" title="Cancel Order" ng-click="grid.appScope.execActions({action : 'showMetroServiceActions', dataItem : { data: row.entity, commonId:row.entity.subGridOptions, selectedAction: 'Cancel Order', selectedResourceType:'Services' ,apiUrl:'/api/metro/mowfm/UpdateOrder'}})" role="menuitem"> <span md-menu-align-target="" class="ng-scope"><i class="glyphicon glyphicon-minus-sign" style="color:#007AA8;font-size:11px;"></i>&nbsp;&nbsp;Cancel Order</span></button>
                                    </md-menu-item>
                                </md-menu-content>
                            </div>
                        </md-menu>
                    </div>
                    <!-- end ngIf: row.entity.resourceId -->
                </div>
                <!-- end ngRepeat: (colRenderIndex, col) in colContainer.renderedColumns track by col.uid -->
                <div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell ng-scope ui-grid-disable-selection ui-grid-coluiGrid-00B4" ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }" role="gridcell" ui-grid-cell="" id="1550368370393-1-uiGrid-00B4-cell">
                    <div class="ui-grid-cell-contents ng-binding ng-scope">ABCD</div>
                </div>
                <!-- end ngRepeat: (colRenderIndex, col) in colContainer.renderedColumns track by col.uid -->
                <div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ui-grid-one-bind-id-grid="rowRenderIndex + '-' + col.uid + '-cell'" class="ui-grid-cell ng-scope ui-grid-disable-selection ui-grid-coluiGrid-00B5" ng-class="{ 'ui-grid-row-header-cell': col.isRowHeader }" role="gridcell" ui-grid-cell="" id="1550368370393-1-uiGrid-00B5-cell">
                    <div class="ui-grid-cell-contents ng-binding ng-scope">ABCD</div>
                </div>
                <!-- end ngRepeat: (colRenderIndex, col) in colContainer.renderedColumns track by col.uid -->
            </div>
            <!-- ngIf: expandableRow.shouldRenderExpand() -->
            <!-- ngIf: expandableRow.shouldRenderFiller() -->
        </div>
        <!-- end ngRepeat: (rowRenderIndex, row) in rowContainer.renderedRows track by $index -->

        <!-- end ngRepeat: (rowRenderIndex, row) in rowContainer.renderedRows track by $index -->
    </div>
</div>
<!-- ngIf: colContainer.needsHScrollbarPlaceholder() -->
<!-- ngIf: grid.options.showColumnFooter -->
</div>
<!-- ngIf: grid.hasRightContainer() -->
<!-- ngIf: grid.options.showGridFooter -->
<!-- ngIf: grid.options.enableColumnMenus -->
<div class="ui-grid-column-menu ng-scope" ui-grid-column-menu="" ng-if="grid.options.enableColumnMenus">
    <div class="ui-grid-menu ng-scope ng-hide" ng-show="shown" aria-hidden="true" style="">
        <style ui-grid-style="" class="ng-binding">
            .grid1550368370393 .ui-grid-menu-mid {
                max-height: 175px;
            }
        </style>
        <div class="ui-grid-menu-mid ng-hide" ng-show="shownMid" aria-hidden="true" style="">
            <!-- ngIf: shown -->
        </div>
    </div>
</div>
<!-- end ngIf: grid.options.enableColumnMenus -->
<div ng-transclude="">
    <div class="grid-msg-overlay ng-scope ng-hide" ng-show="row.entity.subGridOptions.cloading" aria-hidden="true" style="">
        <div class="msg">
            <span>Loading Data &nbsp;<em class="fa fa-spinner fa-spin"></em></span>
        </div>
    </div>
</div>

0 个答案:

没有答案