I’ve got a fair basic grasp about how works, and I’m comfortable at a beginning level using it in VS and C#. However, when it comes to things in pages which are not straight-forward and/or simple, I find it a bit more challenging.


<body class="1-scroll-individual mysite" localization-scope="main">    
  <section-style="overflow: hidden; height: 100%"  id="main-knockout-context" class="default-skin" data-bind...blahblahblahblahblah">
      <div id="layout-window" data-bind="withContext: { @inOverlay: false }">
         <chrome-top params="leftToggle: chrome.left.toggleSize, rightToggle: chrome.right.toggleSize" class="jsx-component-rendered">...</chrome-top>
         <div id="layout-content" data-bind="bindAfter: somethingElse">
            <div id="chrome-left" class="chrome chrome-left chrome-overflow-auto mq-chrome-left" data-bind="css: {...}">...</div>
            <div class="event-stream-popout" data-bind="with: eventStream">...</div>
            <div id="chrome-right" class="chrome-right chrome-overflow-auto mq-chrome-right" data-bind="css: {...}">...</div>
               <div id="content-layout" class="content-layout mq-content-layout smthng-flex" data-bind="css: {.....}">  
               <div class="activity-bar" data-bind="activityBar: true"></div>
                  <sub-page id="content" params="subPage: subPage" class="smthng-flex jsx-component-rendered">
                     <div data-bind="template: template" class="page-inner smthng-flex">
                        <div class="entity-page 1-height-full">
                           <div class="entity-content" data-bind="page: aspect.page">
                              <div class="animate-potential" style="position: relative;">
                                 <div class="page-inner">
                                    <sub-page clas="entity-content-main2 jsx-component-rendered" params="subPage: area.subPage">
                                       <div data-bind="template: template" class="page-inner smthng-flex">
                                          <div class="1-height-full lay-horizontal mysite-ituser>
                                             <div class="entity-content-payload">                       
                                                <article class="home-header">           
                                                   <h2 localize-me>THIS IS THE TITLE I WANT TO ASSERT THE EXISTENCE OF</h2>

What’s the best, or at least a good and solid, way of finding the bottom h2 tag and getting the ? In this example, this is the only h2 tag. But on other similar pages there might be several h2 tags, and I want to find one with a specific content.

All ideas and suggestions are greatly appreciated.

Source link https://sqa.stackexchange.com/questions/25558/selenium--finding--and-contents-in--


Please enter your comment!
Please enter your name here