Selenium Locator Xpath and Use of Regular Expression in Selenium Automation testing Lecture-12
Автор: Gaurav Codes QA
Загружено: 2020-04-14
Просмотров: 1706
Описание:
I have increased font size so that you can watch the video with no pain.
#shorttrickofxpath
RegularExpression
selenium
Note:-
-------------------
css syntax:-
tagname[attribute='value']
------------------
xpath syntax:-
//tagname[@attribute='value']
----------------
short trick of xpath;-
//*[@name='username']
----------------------
Regular expression for css:-
syntax:- tagname[attribute*='value']
It gives us opportunity to do mistake in value and shorten the length of value.
input[name='username']-without regular expression.
input[name*='u']-with regular expression.
Both locators are valid .
----------------------------------
Regular expression for xpath:-
syntax:- //tagname[contains(@attribute,'value')]
//input[@name='username']-using syntax of xpath.
//*[@name='username']-using short trick of xpath.
//input[contains(@name,'u')]-using regular expression.
all three locators are valid.
------------------------------------------
//*[@id="u_0_b"]:-Locators created by browser tools are not reliable and i don't recommend to use them.
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: