Select an element with shared properties on same page #14176
              
                
                  
                  
                    Answered
                  
                  by
                    jennifer-shehane
                  
              
          
                  
                    
                      AutomationDevCypress
                    
                  
                
                  asked this question in
                Component Testing
              
            -
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            jennifer-shehane
          
      
      
        Dec 15, 2020 
      
    
    Replies: 1 comment 1 reply
-
| You can try selecting the first select of the elements found cy.get('select[name="WRQSperiod"]').first().select('YTD')
// or
cy.get('select[name="WRQSperiod"]').eq(0).select('YTD')Or by specifying the css value cy.get('select[name="WRQSperiod"][css="1"]').eq(0).select('YTD') | 
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
      Answer selected by
        AutomationDevCypress
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
You can try selecting the first select of the elements found
Or by specifying the css value