I replaced the locator tagName with cssselector without changing the arguments and the code still worked perfectly. The previous script was:
Driver.findElement(By.tagName("*enter tagName*");
Replacement code is:
Driver.findElement(By.cssSelector("*enter tagName*");
The code worked despite the fact that I did not use any cssSelector combination.
How is that possible?
This worked correctly since tag name alone is a correct CSS Selector.
Generally CSS Selector is may look like the following:
tagName[attributeName='attributeValue']where you can omit the attribute name and value and locate the element based ontagNameonly. SotagNamelonely will still be a correct CSS Selector.