create selenium web element thats not rendered

Viewed 31

ill just dive in. Lets say i have a header with 4 options, but the 4th element is not rendered because I have not clicked a "box" to render it for example:

<html>
  <body>
    <table>
      <tr>
         <th> data 1 </th>
         <th> data 2 </th>
         <th> data 3 </th>
         
         /// Below line is not currently an element ///
         <th> Invisable until something happens<th>
         
      </tr>
     </table>
  </body>
 </html>

even though the last TH exists if a button is pushed or a box is clicked, it is not in the DOM until that action happens. is there a way to use selenium to force that element into the DOM without having to explicitly do the action for it to be visible? granted, what I am clicking is more complex than a simple checkbox. can selenium do something like:

driver.createElement( Non rendered element i am forcing to render )

0 Answers
Related