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
  • 723
  • 1
  • 7
  • 20

2 Answers2

1

cssSelector has or ,

By.cssSelector(".conversation-title, .conv-title")
Guy
  • 40,130
  • 10
  • 33
  • 74
-1

CSS for above element, suppose element type is input

css = input[class*="conv"]

it will search with the class containing 'conv'