0
0
Selenium Javatesting~10 mins

CSS attribute and pseudo-class selectors in Selenium Java - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select an input element with the attribute type="submit".

Selenium Java
WebElement submitButton = driver.findElement(By.cssSelector("input[[1]='submit']"));
Drag options to blanks, or click blank then click option'
Aid
Bname
Cclass
Dtype
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'class' or 'id' instead of 'type' in the attribute selector.
2fill in blank
medium

Complete the code to select all links (<a>) that have an href attribute starting with 'https'.

Selenium Java
List<WebElement> secureLinks = driver.findElements(By.cssSelector("a[[1]^='https']"));
Drag options to blanks, or click blank then click option'
Ahref
Bsrc
Calt
Dtitle
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'src' or 'alt' which are not attributes of tags.