0

So, in my project all my locators are the elements of enum and looks like:

if it is a css locator - DIV_LOCATION("css=div.location-text.text-overflow"). It parse the string and if starts with css= it know that it is a css locator.

If it is a xpath locator - DIV_HEADER_GRP_TITLE("//*[contains(@class,'conversation-title')]//div")

I want to write the universal css locator that will locate this two elements: <div class = 'conv-title'>...</div> and <div class = 'conversation-title'>...</div>

How can I do it?

The locator must starts with css=

Roman Shmandrovskyi
  • 883
  • 2
  • 8
  • 22

2 Answers2

1

cssSelector has or ,

By.cssSelector(".conversation-title, .conv-title")
Guy
  • 46,488
  • 10
  • 44
  • 88
-1

CSS for above element, suppose element type is input

css = input[class*="conv"]

it will search with the class containing 'conv'