{"id":399125,"date":"2024-06-29T14:29:03","date_gmt":"2024-06-29T14:29:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=399125"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=399125","title":{"rendered":"<span>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Selenium<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ec7\/146\/157\/ec714615763739c36b0751affaecd21f.png\" width=\"780\" height=\"439\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ec7\/146\/157\/ec714615763739c36b0751affaecd21f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>TestNG \u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430<a href=\"https:\/\/www.lambdatest.com\/automation-testing\"><u> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/u><\/a> \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u0432 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0432 TestNG \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0445 \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432 \u0438\u043b\u0438 \u0432\u044b \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0432\u0445\u043e\u0434\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0432\u0430\u0440\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 TestNG \u0432\u0441\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d19\/191\/453\/d191914531400c546b3672ba6bca2ed8.png\" width=\"643\" height=\"536\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d19\/191\/453\/d191914531400c546b3672ba6bca2ed8.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0431\u043b\u043e\u0433\u0430\u0445 \u044d\u0442\u043e\u0439 <a href=\"https:\/\/www.lambdatest.com\/learning-hub\/testng\"><u>\u0441\u0435\u0440\u0438\u0438 \u0443\u0440\u043e\u043a\u043e\u0432 \u043f\u043e Selenium TestNG <\/u><\/a>\u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438, <a href=\"https:\/\/www.lambdatest.com\/blog\/how-to-install-testng-in-eclipse-step-by-step-guide\/\"><u>\u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c TestNG<\/u><\/a>, <a href=\"https:\/\/www.lambdatest.com\/blog\/complete-guide-on-testng-annotations-for-selenium-webdriver\/\"><u>\u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0432 TestNG<\/u><\/a> \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u0412 \u044d\u0442\u043e\u043c \u0431\u043b\u043e\u0433\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Selenium.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c!<\/p>\n<p><strong>\u0421\u041e\u0414\u0415\u0420\u0416\u0410\u041d\u0418\u0415<\/strong><\/p>\n<ol>\n<li>\n<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG?<\/p>\n<\/li>\n<li>\n<p>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Selenium?<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 TestNG \u043f\u0440\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c<\/p>\n<\/li>\n<\/ol>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG?<\/h3>\n<p>\u0412 TestNG \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u2014 \u044d\u0442\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0438 \u0445\u043e\u0442\u044f\u0442, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u044b.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432 \u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 (Priority) \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG. \u0422\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u0432, \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u044b \u0441 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c\u0438.<\/p>\n<h3>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e @Test (priority=X). \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043b\u0438 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0443 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 1.<\/p>\n<pre><code class=\"java\">@Test(priority = 1) public void myTestCaseWithPriority() {    try {        System.out.println(\"I am in my first testcase with priority=1\");    } catch (Exception e) {    } }<\/code><\/pre>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 TestNG?<\/h3>\n<p>\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 TestNG \u0440\u0430\u0432\u0435\u043d 0. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG \u0434\u043b\u044f \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432, TestNG \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 0.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0438\u0436\u0435 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u043d\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u043c\u0443 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 0.<\/p>\n<pre><code class=\"java\">@Test public void myTestCaseWithDefaultPriority() {    try {        System.out.println(\"I am in my first testcase with default priority\");    } catch (Exception e) {      } }<\/code><\/pre>\n<p>\u0421 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 TestNG \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0432\u044b\u043a\u0438 \u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e TestNG \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u044e \u043a\u0430\u0440\u044c\u0435\u0440\u0443 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 TestNG \u043e\u0442 LambdaTest:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/618bdeabcd09f7f6552eb409\" data-style=\"\" id=\"618bdeabcd09f7f6552eb409\" width=\"\"><\/div>\n<h3>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0432 TestNG?<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0434\u0430\u0435\u0442\u0435\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043b\u044e\u0431\u043e\u043c\u0443 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0443, \u0442\u043e \u043e\u0442\u0432\u0435\u0442 \u2014 \u0414\u0430! \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u043a\u043e\u0433\u0434\u0430 \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0438\u043c\u0435\u043b\u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043d\u0430\u0434 \u0442\u0435\u043c\u0438, \u0447\u0442\u043e \u0441\u0442\u043e\u044f\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 0, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0442.\u0435. -1. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u0435\u0442\u043e\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c, \u0430 \u0437\u0430\u0442\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<pre><code class=\"java\">@Test public void myTestCaseWithDefaultPriority() {    try {        System.out.println(\"I am in my first testcase with default priority\");    } catch (Exception e) {      }   }   @Test(priority = -1) public void myTestCaseWithNegativePriority() {    try {        System.out.println(\"I am in my first testcase with negative priority\");    } catch (Exception e) {      }   }<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/437\/ee3\/0a6\/437ee30a6af6ac087646c85f791f6992.png\" width=\"627\" height=\"73\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/437\/ee3\/0a6\/437ee30a6af6ac087646c85f791f6992.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0447\u0442\u0438\u0442\u0435: <a href=\"https:\/\/www.lambdatest.com\/blog\/how-to-use-dataproviders-in-testng-with-examples\/\"><u>How To Use DataProviders In TestNG [With Examples]<\/u><\/a><\/p>\n<h3>\u041a\u0430\u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0432 TestNG?<\/h3>\n<p>\u0412\u0430\u043c \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0441\u0435 \u0438\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 TestNG \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u043e\u043c\u0443 \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043f\u0440\u0438 \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0442\u0435\u0441\u0442-\u043c\u0435\u0442\u043e\u0434\u0430 (a \u0438 b), \u0438 \u043e\u0431\u0430 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0440\u0430\u0432\u043d\u044b\u0439 0. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c: \u043c\u0435\u0442\u043e\u0434 a, \u0430 \u0437\u0430\u0442\u0435\u043c b.<\/p>\n<pre><code class=\"java\">@Test public void a() {    try {        System.out.println(\"A\");    } catch (Exception e) {      }   }   @Test public void b() {    try {        System.out.println(\"B\");    } catch (Exception e) {      }   }<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8f2\/93c\/cdd\/8f293ccdd480db971a085bad3235ce9f.png\" width=\"494\" height=\"71\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8f2\/93c\/cdd\/8f293ccdd480db971a085bad3235ce9f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0447\u0442\u0438\u0442\u0435: <a href=\"https:\/\/www.lambdatest.com\/blog\/parameterization-in-testng-dataprovider-and-testng-xml-examples\/\">Parameterization In TestNG \u2013 DataProvider and TestNG XML (With Examples)<\/a><\/p>\n<h3>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Selenium?<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0431\u043b\u043e\u0433\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u043c\u044b \u0438\u0437\u0443\u0447\u0438\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u044b \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0432 TestNG. \u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e Selenium TestNG \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG \u0438\u043b\u0438 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG.<\/p>\n<p>\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<p>\u041c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <a href=\"http:\/\/labs.lambdatest.com\/selenium-playground\/\"><u>Selenium Playground<\/u><\/a>, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u0443\u044e LambdaTest, \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432.<\/p>\n<p>LambdaTest \u2014 \u044d\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 <a href=\"https:\/\/www.lambdatest.com\/feature\"><u>\u043a\u0440\u043e\u0441\u0441\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/u><\/a>. \u0418\u043c\u0435\u044f \u0432 \u0441\u0432\u043e\u0435\u043c \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0435 \u0431\u043e\u043b\u0435\u0435 2000 <a href=\"https:\/\/www.lambdatest.com\/virtual-browsers\"><u>\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 <\/u><\/a>\u0438 \u041e\u0421, \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0443\u0447\u043d\u044b\u043c\u0438 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3da\/2ad\/8e7\/3da2ad8e7f3ad86620e44dff8990c38d.png\" width=\"1790\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3da\/2ad\/8e7\/3da2ad8e7f3ad86620e44dff8990c38d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/p>\n<p>\u041c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043d\u0438\u0436\u0435:<\/p>\n<ul>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0438 \u0431\u0435\u0437 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 TestNG \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<a href=\"https:\/\/www.lambdatest.com\/blog\/selenium-webdriver-tutorial-with-examples\/\"><u> Selenium WebDriver<\/u><\/a>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0431\u043b\u043e\u0433\u0443 <a href=\"https:\/\/www.lambdatest.com\/blog\/create-testng-project-in-eclipse-run-selenium-test-script\/\"><u>\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 TestNG \u0432 Eclipse \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f Selenium Test.<\/u><\/a><\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0432 TestNG<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e Selenium TestNG \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 Selenium.<\/p>\n<pre><code class=\"java\">package LamdaTest; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.Reporter; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import java.net.MalformedURLException; import java.net.URL;  class SeleniumPlaygroundTestsWithoutPriority {      public String username = \"YOUR USERNAME\";    public String accesskey = \"YOUR ACCESSKEY\";    public static RemoteWebDriver driver = null;    public String gridURL = \"@hub.lambdatest.com\/wd\/hub\";     @BeforeClass    public void setUp() throws Exception {        DesiredCapabilities capabilities = new DesiredCapabilities();        capabilities.setCapability(\"browserName\", \"chrome\");        capabilities.setCapability(\"version\", \"94.0\");        capabilities.setCapability(\"platform\", \"win10\"); \/\/ If this cap isn't specified, it will just get the any available one        capabilities.setCapability(\"build\", \"TestNGWithoutPriorityTests\");        capabilities.setCapability(\"name\", \"TestNGWithoutPriorityTestsSample\");        try {            driver = new RemoteWebDriver(new URL(\"https:\/\/\" + username + \":\" + accesskey + gridURL), capabilities);        } catch (MalformedURLException e) {            System.out.println(\"Invalid grid URL\");        } catch (Exception e) {            System.out.println(e.getMessage());        }        Reporter.log(\"Logging into Selenium Playground\", true);        driver.get(\"http:\/\/labs.lambdatest.com\/selenium-playground\/\");    }     @Test    public void getFirstOptionName() {        try {            WebElement option1 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[1]\"));            Reporter.log(\"The First Option Is: \" + option1.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getSecondOptionName() {        try {            WebElement option2 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[2]\"));            Reporter.log(\"The Second Option Is: \" + option2.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getThirdOptionName() {        try {            WebElement option3 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[3]\"));            Reporter.log(\"The Third Option Is: \" + option3.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getFourthOptionName() {        try {            WebElement option4 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[4]\"));            Reporter.log(\"The Fourth Option Is: \" + option4.getText(), true);        } catch (Exception e) {         }     }      @Test    public void getFifthOptionName() {        try {            WebElement option5 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[5]\"));            Reporter.log(\"The Fifth Option Is: \" + option5.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getSixthOptionName() {        try {            WebElement option6 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[6]\"));            Reporter.log(\"The Sixth Option Is: \" + option6.getText(), true);        } catch (Exception e) {         }     }     @AfterClass    public void closeBrowser() {        driver.close();        Reporter.log(\"Closing the browser\", true);     }  }<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u0444\u0430\u0439\u043b testng.xml \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<pre><code class=\"java\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?> &lt;!DOCTYPE suite SYSTEM \"http:\/\/testng.org\/testng-1.0.dtd\"> &lt;suite  name=\"TestNGPriorityTest\">     &lt;test name=\"TestNGPriorityTest\" >        &lt;classes>            &lt;class name=\"LamdaTest.SeleniumPlaygroundTestsWithoutPriority\">            &lt;\/class>        &lt;\/classes>    &lt;\/test> &lt;\/suite><\/code><\/pre>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 pom.xml \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<pre><code class=\"java\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?> &lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"         xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"         xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\">    &lt;modelVersion>4.0.0&lt;\/modelVersion>     &lt;groupId>org.example&lt;\/groupId>    &lt;artifactId>LambdaTest&lt;\/artifactId>    &lt;version>1.0-SNAPSHOT&lt;\/version>    &lt;dependencies>        &lt;dependency>            &lt;groupId>org.seleniumhq.selenium&lt;\/groupId>            &lt;artifactId>selenium-api&lt;\/artifactId>            &lt;version>4.0.0-alpha-7&lt;\/version>        &lt;\/dependency>        &lt;dependency>            &lt;groupId>org.testng&lt;\/groupId>            &lt;artifactId>testng&lt;\/artifactId>            &lt;version>6.14.3&lt;\/version>        &lt;\/dependency>        &lt;dependency>            &lt;groupId>org.seleniumhq.selenium&lt;\/groupId>            &lt;artifactId>selenium-remote-driver&lt;\/artifactId>            &lt;version>4.0.0-alpha-7&lt;\/version>        &lt;\/dependency>    &lt;\/dependencies>     &lt;properties>        &lt;maven.compiler.source>8&lt;\/maven.compiler.source>        &lt;maven.compiler.target>8&lt;\/maven.compiler.target>    &lt;\/properties>  &lt;\/project><\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0447\u0438\u0442\u0430\u0439\u0442\u0435: <a href=\"https:\/\/www.lambdatest.com\/blog\/grouping-test-cases-in-testng\/\"><u>How To Group Test Cases In TestNG [with Examples]<\/u><\/a><\/p>\n<p>\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043a\u043e\u0434\u0430:<\/p>\n<ol>\n<li>\n<p><strong>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<\/strong> \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044f Desired Capabilities, Reporter Class \u0438 \u0442.\u0434., \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u043b\u0430\u0441\u0441 Reporter \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0432 TestNG \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 HTML-\u043e\u0442\u0447\u0435\u0442\u0430\u0445 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u0432\u044b\u0432\u043e\u0434\u0435.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/www.lambdatest.com\/blog\/how-to-use-testng-reporter-log-in-selenium\/\"><u>How to Use TestNG Reporter Class In Selenium<\/u><\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f Reporter Class.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/614\/683\/e8b\/614683e8bec398cf20322731aed4167c.png\" width=\"1281\" height=\"683\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/614\/683\/e8b\/614683e8bec398cf20322731aed4167c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0447\u0438\u0442\u0430\u0439\u0442\u0435: <a href=\"https:\/\/www.lambdatest.com\/blog\/how-to-generate-testng-reports-in-jenkins\/\">How To Generate TestNG Reports In Jenkins?<\/a><\/p>\n<p><strong>2. \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435: <\/strong>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/www.lambdatest.com\/selenium-automation\"><u>\u043e\u043d\u043b\u0430\u0439\u043d Selenium Grid<\/u><\/a> \u0442\u0438\u043f\u0430 LamdaTest \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f<a href=\"https:\/\/www.lambdatest.com\/blog\/what-is-parallel-testing-and-why-to-adopt-it\/\"><u> \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/u><\/a>. \u0417\u0434\u0435\u0441\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043a\u043b\u044e\u0447\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u0432\u043e\u0439\u0434\u044f \u0432 <a href=\"https:\/\/accounts.lambdatest.com\/detail\/profile\"><u>\u0440\u0430\u0437\u0434\u0435\u043b \u043f\u0440\u043e\u0444\u0438\u043b\u044f LamdaTest<\/u><\/a>. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u0434\u0435. \u041e\u0434\u043d\u0430\u043a\u043e URL \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0438\u043c, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6e8\/06a\/cca\/6e806acca7669a2466a9ae408dcb6558.png\" width=\"739\" height=\"283\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e8\/06a\/cca\/6e806acca7669a2466a9ae408dcb6558.png\"\/><figcaption><\/figcaption><\/figure>\n<p><strong>3. @BeforeClass(Setup Method)<\/strong>: \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 LamdaTest<a href=\"https:\/\/www.lambdatest.com\/capabilities-generator\/\"><u> Desired Capabilities Generator<\/u><\/a> \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 (\u0438\u043c\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0432\u0435\u0440\u0441\u0438\u044f, \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0438 \u0442.\u0434.) \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e <a href=\"https:\/\/www.lambdatest.com\/blog\/selenium-remotewebdriver\/\"><u>Selenium Remote Web Driver<\/u><\/a>.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u043c\u0443 \u0431\u043b\u043e\u0433\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u0430\u0436\u043d\u044b\u0435 <a href=\"https:\/\/www.lambdatest.com\/blog\/complete-guide-on-testng-annotations-for-selenium-webdriver\/\"><u>\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 TestNG<\/u><\/a>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0435\u0431-\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041d\u0430\u0440\u044f\u0434\u0443 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043c\u044b \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u0432 Selenium Playground \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 Before Class, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u043e\u0439\u0434\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043e\u0434\u0438\u043d \u0440\u0430\u0437.<\/p>\n<p>\u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &#171;Logging into Selenium Playground&#187; \u0432 \u043d\u0430\u0448\u0435\u043c HTML-\u043e\u0442\u0447\u0435\u0442\u0435 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u0432\u044b\u0432\u043e\u0434\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 Reporter.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bb6\/eb3\/723\/bb6eb3723349ab282f6510fa762674cd.png\" width=\"1441\" height=\"632\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bb6\/eb3\/723\/bb6eb3723349ab282f6510fa762674cd.png\"\/><figcaption><\/figcaption><\/figure>\n<p><strong>4. @Test(getFirstOptionName)<\/strong>: \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 Selenium Playground, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043d\u0438\u0436\u0435. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0442\u043e\u0433\u043e \u0436\u0435 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043b\u0430\u0441\u0441 Reporter, \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432 HTML-\u043e\u0442\u0447\u0435\u0442\u0435. \u0417\u0434\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0431\u0443\u0434\u0435\u0442 Input Forms.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/628\/40e\/d94\/62840ed94aec24853940f3b95032cdf8.png\" width=\"1689\" height=\"466\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/628\/40e\/d94\/62840ed94aec24853940f3b95032cdf8.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u044f\u0432\u043d\u043e \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u043c\u0435\u0442\u043e\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0440\u0430\u0432\u043d\u044b\u0439 0.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/917\/150\/be5\/917150be5b4175d9ffbd4a1055111005.png\" width=\"1272\" height=\"368\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/917\/150\/be5\/917150be5b4175d9ffbd4a1055111005.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 XPath \u0432 \u043d\u0430\u0448\u0435\u043c \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c XPath \u043b\u044e\u0431\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043f\u0440\u043e\u0441\u0442\u043e \u0449\u0435\u043b\u043a\u043d\u0443\u0432 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u2192 Inspect Option. \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443 \u043f\u043e <a href=\"https:\/\/www.lambdatest.com\/blog\/complete-guide-for-using-xpath-in-selenium-with-examples\/\"><u>XPath \u0432 Selenium<\/u><\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c XPath \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0432 DOM.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e1c\/a53\/00a\/e1ca5300a0092231060cbcbf5c01f053.png\" width=\"732\" height=\"780\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e1c\/a53\/00a\/e1ca5300a0092231060cbcbf5c01f053.png\"\/><figcaption><\/figcaption><\/figure>\n<p><strong>5. @Test(getSecondOptionName)<\/strong>: \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Selenium Playground. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0442\u043e\u0433\u043e \u0436\u0435 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043b\u0430\u0441\u0441 Reporter, \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432 HTML-\u043e\u0442\u0447\u0435\u0442\u0435. \u0417\u0434\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0431\u0443\u0434\u0435\u0442 Progress Bars &amp; Sliders. \u041c\u0435\u0442\u043e\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0434\u0435\u0441\u044c \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 0.<\/p>\n<p><strong>6. @Test(getThirdOptionName):<\/strong> \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 Selenium Playground. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043b\u0430\u0441\u0441 Reporter \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432 HTML-\u043e\u0442\u0447\u0435\u0442\u0435. \u0417\u0434\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0431\u0443\u0434\u0435\u0442 Alerts &amp; Modals. \u041c\u0435\u0442\u043e\u0434 \u0442\u0435\u0441\u0442\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0432\u043d\u044b\u043c 0.<\/p>\n<p><strong>7. @Test(getFourthOptionName)<\/strong>: \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 Selenium Playground. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0442\u043e\u0433\u043e \u0436\u0435 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043b\u0430\u0441\u0441 Reporter \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432 HTML-\u043e\u0442\u0447\u0435\u0442\u0435. \u0417\u0434\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0431\u0443\u0434\u0435\u0442 Date Pickers.<\/p>\n<p><strong>8. @Test(getFifthOptionName):<\/strong> \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043f\u044f\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 Selenium Playground. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0442\u043e\u0433\u043e \u0436\u0435 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043b\u0430\u0441\u0441 Reporter \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432 HTML-\u043e\u0442\u0447\u0435\u0442\u0435. \u0417\u0434\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434 Table.<\/p>\n<p><strong>9. @Test(getSixthOptionName):<\/strong> \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0448\u0435\u0441\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 Selenium Playground. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0442\u043e\u0433\u043e \u0436\u0435 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043b\u0430\u0441\u0441 Reporter \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432 HTML-\u043e\u0442\u0447\u0435\u0442\u0435. \u0417\u0434\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0432\u0435\u0431-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0431\u0443\u0434\u0435\u0442 List Box.<\/p>\n<p><strong>10. @AfterClass(closeBrowser)<\/strong>: \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0430, \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/strong><\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u0431\u044b\u043b \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, TestNG \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442 \u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 0. \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u0430\u043a \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u043b\u043e\u0441\u044c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &#171;\u0422\u0435\u0441\u0442\u044b \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0432 TestNG&#187;, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c, TestNG \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u043e\u043c\u0443 \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043f\u0440\u0438 \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6ff\/0d3\/3b7\/6ff0d33b71ada8cff8dc9b679e1e4a49.png\" width=\"1299\" height=\"639\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ff\/0d3\/3b7\/6ff0d33b71ada8cff8dc9b679e1e4a49.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 <a href=\"https:\/\/automation.lambdatest.com\/timeline\/\"><u>LambdaTest Automation Dashboard<\/u><\/a>.<\/p>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0430 \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u0432\u0438\u0434\u0435\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0442\u0430\u043b\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043b\u043e\u0433\u0438 \u0438\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/de2\/258\/8ad\/de22588ad1a26a082c6673183bf712cd.png\" width=\"1717\" height=\"765\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/de2\/258\/8ad\/de22588ad1a26a082c6673183bf712cd.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0447\u0438\u0442\u0430\u0439\u0442\u0435: <a href=\"https:\/\/www.lambdatest.com\/blog\/testng-listeners-in-selenium-webdriver-with-examples\/\">TestNG Listeners In Selenium WebDriver With Examples<\/a><\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0432 TestNG<\/h3>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u0430 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u0432\u044b \u0432\u0438\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043f\u043e\u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f \u0442\u043e\u0442 \u0436\u0435 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441, \u0435\u0441\u043b\u0438 \u043c\u044b \u044f\u0432\u043d\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Selenium.<\/p>\n<pre><code class=\"java\">package LamdaTest;  import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.Reporter; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test;  import java.net.MalformedURLException; import java.net.URL;  class SeleniumPlaygroundTestsWithPriority {      public String username = \"YOUR USERNAME\";    public String accesskey = \"YOUR ACCESSKEY\";    public static RemoteWebDriver driver = null;    public String gridURL = \"@hub.lambdatest.com\/wd\/hub\";     @BeforeClass    public void setUp() throws Exception {        DesiredCapabilities capabilities = new DesiredCapabilities();        capabilities.setCapability(\"browserName\", \"chrome\");        capabilities.setCapability(\"version\", \"93.0\");        capabilities.setCapability(\"platform\", \"win10\"); \/\/ If this cap isn't specified, it will just get the any available one        capabilities.setCapability(\"build\", \"TestNGWithPriorityTests\");        capabilities.setCapability(\"name\", \"TestNGWithPriorityTestsSample\");        try {            driver = new RemoteWebDriver(new URL(\"https:\/\/\" + username + \":\" + accesskey + gridURL), capabilities);        } catch (MalformedURLException e) {            System.out.println(\"Invalid grid URL\");        } catch (Exception e) {            System.out.println(e.getMessage());        }        Reporter.log(\"Logging into Selenium Playground\", true);        driver.get(\"http:\/\/labs.lambdatest.com\/selenium-playground\/\");    }     @Test(priority = 1)    public void getFirstOptionName() {        try {            WebElement option1 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[1]\"));            Reporter.log(\"The First Option Is: \" + option1.getText(), true);            System.out.println(\"I am in my first testcase with priority=1\");        } catch (Exception e) {         }     }     @Test(priority = 2)    public void getSecondOptionName() {        try {            WebElement option2 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[2]\"));            Reporter.log(\"The Second Option Is: \" + option2.getText(), true);        } catch (Exception e) {         }     }     @Test(priority = 3)    public void getThirdOptionName() {        try {            WebElement option3 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[3]\"));            Reporter.log(\"The Third Option Is: \" + option3.getText(), true);        } catch (Exception e) {         }     }     @Test(priority = 4)    public void getFourthOptionName() {        try {            WebElement option4 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[4]\"));            Reporter.log(\"The Fourth Option Is: \" + option4.getText(), true);        } catch (Exception e) {         }     }      @Test(priority = 5)    public void getFifthOptionName() {        try {            WebElement option5 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[5]\"));            Reporter.log(\"The Fifth Option Is: \" + option5.getText(), true);        } catch (Exception e) {         }     }     @Test(priority = 6)    public void getSixthOptionName() {        try {            WebElement option6 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[6]\"));            Reporter.log(\"The Sixth Option Is: \" + option6.getText(), true);        } catch (Exception e) {         }     }     @AfterClass    public void closeBrowser() {        driver.close();        Reporter.log(\"Closing the browser\", true);     }  }<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u0444\u0430\u0439\u043b testng.xml \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 Java.<\/p>\n<pre><code class=\"java\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?> &lt;!DOCTYPE suite SYSTEM \"http:\/\/testng.org\/testng-1.0.dtd\"> &lt;suite  name=\"TestNGPriorityTest\">     &lt;test name=\"TestNGPriorityTest\" >        &lt;classes>            &lt;class name=\"LamdaTest.SeleniumPlaygroundTestsWithPriority\">            &lt;\/class>        &lt;\/classes>    &lt;\/test> &lt;\/suite><\/code><\/pre>\n<p><strong>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430:<\/strong><\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442.<\/p>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/strong><\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b, TestNG \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u0432. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0435\u0440\u0432\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u043c\u0435\u0442\u043e\u0434 getFirstOptionName \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c=1, \u0437\u0430\u0442\u0435\u043c getSecondOptionName \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c=2 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c48\/6f8\/24c\/c486f824c65094bd760fe172e30ffc29.png\" width=\"835\" height=\"629\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c48\/6f8\/24c\/c486f824c65094bd760fe172e30ffc29.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043b\u043e\u0433\u0438 \u0432 LamdaTest Automation Dashboard.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f57\/da8\/cc6\/f57da8cc6299ed82df3d99577c5e6133.png\" width=\"1137\" height=\"487\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f57\/da8\/cc6\/f57da8cc6299ed82df3d99577c5e6133.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0432 TestNG<\/h3>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u0430 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u043c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u043a\u0430\u043a \u043b\u0435\u0433\u043a\u043e TestNG \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0435\u0442 \u043d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0445 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f, \u043d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442. \u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430, \u0435\u0441\u043b\u0438 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043d\u0430\u0448\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c.<\/p>\n<pre><code class=\"java\">package LamdaTest;  import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.Reporter; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test;  import java.net.MalformedURLException; import java.net.URL;  class SeleniumPlaygroundTestsWithSamePriority {      public String username = \"YOUR USERNAME\";    public String accesskey = \"YOUR ACCESSKEY\";    public static RemoteWebDriver driver = null;    public String gridURL = \"@hub.lambdatest.com\/wd\/hub\";     @BeforeClass    public void setUp() throws Exception {        DesiredCapabilities capabilities = new DesiredCapabilities();        capabilities.setCapability(\"browserName\", \"chrome\");        capabilities.setCapability(\"version\", \"93.0\");        capabilities.setCapability(\"platform\", \"win10\"); \/\/ If this cap isn't specified, it will just get the any available one        capabilities.setCapability(\"build\", \"TestNGWithSamePriorityTests\");        capabilities.setCapability(\"name\", \"TestNGWithSamePriorityTestsSample\");        try {            driver = new RemoteWebDriver(new URL(\"https:\/\/\" + username + \":\" + accesskey + gridURL), capabilities);        } catch (MalformedURLException e) {            System.out.println(\"Invalid grid URL\");        } catch (Exception e) {            System.out.println(e.getMessage());        }        Reporter.log(\"Logging into Selenium Playground\", true);        driver.get(\"http:\/\/labs.lambdatest.com\/selenium-playground\/\");    }     @Test(priority = 1)    public void getFirstOptionName() {        try {            WebElement option1 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[1]\"));            Reporter.log(\"The First Option Is: \" + option1.getText(), true);        } catch (Exception e) {         }     }     @Test(priority = 1)    public void getSecondOptionName() {        try {            WebElement option2 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[2]\"));            Reporter.log(\"The Second Option Is: \" + option2.getText(), true);        } catch (Exception e) {         }     }     @Test(priority = 2)    public void getThirdOptionName() {        try {            WebElement option3 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[3]\"));            Reporter.log(\"The Third Option Is: \" + option3.getText(), true);        } catch (Exception e) {         }     }     @Test(priority = -1)    public void getFourthOptionName() {        try {            WebElement option4 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[4]\"));            Reporter.log(\"The Fourth Option Is: \" + option4.getText(), true);        } catch (Exception e) {         }     }      @Test(priority = -2)    public void getFifthOptionName() {        try {            WebElement option5 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[5]\"));            Reporter.log(\"The Fifth Option Is: \" + option5.getText(), true);        } catch (Exception e) {         }     }     @Test(priority = -3)    public void getSixthOptionName() {        try {            WebElement option6 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[6]\"));            Reporter.log(\"The Sixth Option Is: \" + option6.getText(), true);        } catch (Exception e) {         }     }     @AfterClass    public void closeBrowser() {        driver.close();        Reporter.log(\"Closing the browser\", true);     }  }<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u0444\u0430\u0439\u043b testng.xml \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 Java.<\/p>\n<pre><code class=\"java\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?> &lt;!DOCTYPE suite SYSTEM \"http:\/\/testng.org\/testng-1.0.dtd\"> &lt;suite  name=\"TestNGPriorityTest\">     &lt;test name=\"TestNGPriorityTest\" >        &lt;classes>            &lt;class name=\"LamdaTest.SeleniumPlaygroundTestsWithSamePriority\">            &lt;\/class>        &lt;\/classes>    &lt;\/test> &lt;\/suite><\/code><\/pre>\n<p><strong>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430:<\/strong><\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0438 \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u043f\u0440\u0438\u0447\u0435\u043c \u0434\u0432\u0430 \u0438\u0437 \u043d\u0438\u0445 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u0443\u0435\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0430\u0448\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. \u0417\u0434\u0435\u0441\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 getSixthOptionName \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0437\u043a\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 -3, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u0435\u0440\u0432\u044b\u043c, \u0437\u0430 \u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 getFifthOptionName \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c = -2, \u0430 \u0437\u0430\u0442\u0435\u043c getFourthOptionName \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c = -1.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0438\u0445 \u0438\u0434\u0443\u0442 \u0434\u0432\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430 getFirstOptionName \u0438 getSecondOptionName \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c = 1. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u0437 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0435\u0440\u0432\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d getFirstOptionName, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u0438\u0434\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0443, \u0437\u0430 \u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 getSecondOptionName. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u043c\u0435\u0442\u043e\u0434 getThirdOptionName, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c = 2.<\/p>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/strong><\/p>\n<p>\u041a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/05e\/749\/375\/05e749375bb6dfd2f1946a7a77fb8d33.png\" width=\"800\" height=\"489\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/05e\/749\/375\/05e749375bb6dfd2f1946a7a77fb8d33.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043b\u043e\u0433\u0438 \u0432 LamdaTest Automation Dashboard.<\/p>\n<p><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3f0\/6ac\/87f\/3f06ac87fec15eee67ed99f7f23e5a8e.png\" width=\"1110\" height=\"509\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3f0\/6ac\/87f\/3f06ac87fec15eee67ed99f7f23e5a8e.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u043c\u0438 \u0438 \u043d\u0435\u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0432 TestNG<\/h3>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u0430 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0438 \u043b\u0438\u0431\u043e \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0431\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430, \u043b\u0438\u0431\u043e \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c. \u041d\u043e \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u0438\u043c\u0435\u0442\u044c \u0432 TestNG \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e \u043a\u0430\u043a \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u0445, \u0442\u0430\u043a \u0438 \u043d\u0435\u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432? \u041e\u0442\u0432\u0435\u0442 &#8212; \u0414\u0410.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0438 \u043f\u043e\u0439\u043c\u0435\u043c, \u043a\u0430\u043a TestNG \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445.<\/p>\n<pre><code class=\"java\">package LamdaTest;  import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.Reporter; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test;  import java.net.MalformedURLException; import java.net.URL;  class SeleniumPlaygroundTestsWithAndWithoutPriority {      public String username = \"YOUR USERNAME\";    public String accesskey = \"YOUR ACCESSKEY\";    public static RemoteWebDriver driver = null;    public String gridURL = \"@hub.lambdatest.com\/wd\/hub\";     @BeforeClass    public void setUp() throws Exception {        DesiredCapabilities capabilities = new DesiredCapabilities();        capabilities.setCapability(\"browserName\", \"chrome\");        capabilities.setCapability(\"version\", \"93.0\");        capabilities.setCapability(\"platform\", \"win10\"); \/\/ If this cap isn't specified, it will just get the any available one        capabilities.setCapability(\"build\", \"TestNGWithAndWithoutPriorityTests\");        capabilities.setCapability(\"name\", \"TestNGWithAndWithoutPriorityTestsSample\");        try {            driver = new RemoteWebDriver(new URL(\"https:\/\/\" + username + \":\" + accesskey + gridURL), capabilities);        } catch (MalformedURLException e) {            System.out.println(\"Invalid grid URL\");        } catch (Exception e) {            System.out.println(e.getMessage());        }        Reporter.log(\"Logging into Selenium Playground\", true);        driver.get(\"http:\/\/labs.lambdatest.com\/selenium-playground\/\");    }     @Test    public void getFirstOptionName() {        try {            WebElement option1 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[1]\"));            Reporter.log(\"The First Option Is: \" + option1.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getSecondOptionName() {        try {            WebElement option2 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[2]\"));            Reporter.log(\"The Second Option Is: \" + option2.getText(), true);        } catch (Exception e) {         }     }     @Test(priority = 1)    public void getThirdOptionName() {        try {            WebElement option3 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[3]\"));            Reporter.log(\"The Third Option Is: \" + option3.getText(), true);        } catch (Exception e) {         }     }     @Test(priority = 1)    public void getFourthOptionName() {        try {            WebElement option4 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[4]\"));            Reporter.log(\"The Fourth Option Is: \" + option4.getText(), true);        } catch (Exception e) {         }     }      @Test(priority = 0)    public void getFifthOptionName() {        try {            WebElement option5 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[5]\"));            Reporter.log(\"The Fifth Option Is: \" + option5.getText(), true);        } catch (Exception e) {         }     }     @Test(priority = 2)    public void getSixthOptionName() {        try {            WebElement option6 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[6]\"));            Reporter.log(\"The Sixth Option Is: \" + option6.getText(), true);        } catch (Exception e) {         }     }     @AfterClass    public void closeBrowser() {        driver.close();        Reporter.log(\"Closing the browser\", true);     }  }<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 testng.xml \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 Java.<\/p>\n<pre><code class=\"java\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?> &lt;!DOCTYPE suite SYSTEM \"http:\/\/testng.org\/testng-1.0.dtd\"> &lt;suite  name=\"TestNGPriorityTest\">     &lt;test name=\"TestNGPriorityTest\" >        &lt;classes>            &lt;class name=\"LamdaTest.SeleniumPlaygroundTestsWithAndWithoutPriority\">            &lt;\/class>        &lt;\/classes>    &lt;\/test> &lt;\/suite><\/code><\/pre>\n<p><strong>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430:<\/strong><\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c-\u043a\u0435\u0439\u0441\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c \u0436\u0435, \u0447\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u0437\u0434\u0435\u0441\u044c \u0431\u044b\u043b \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0430\u0448\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. \u0417\u0434\u0435\u0441\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 getFifthOptionName \u0431\u044b\u043b \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 =0, \u043d\u043e \u043e\u043d \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u0443\u0440\u043e\u0432\u043d\u0435, \u0447\u0442\u043e \u0438 \u043c\u0435\u0442\u043e\u0434\u044b getFirstOptionName \u0438 getSecondOptionName, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443, \u0445\u043e\u0442\u044f \u0438\u043c \u043d\u0435 \u0431\u044b\u043b \u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0432\u0435\u043d 0. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u0437 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0442\u0440\u0435\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0435\u0440\u0432\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d getFifthOptionName, \u0437\u0430\u0442\u0435\u043c getFirstOptionName \u0438 getSecondOptionName, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0438\u0445 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a. \u041f\u043e\u0441\u043b\u0435 \u043d\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 getFourthOptionName, \u0437\u0430\u0442\u0435\u043c getThirdOptionName, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0431\u0430 \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0440\u0430\u0432\u043d\u044b\u0439 1. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d getSixthOptionName, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c 2.<\/p>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/strong><\/p>\n<p>\u041a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/343\/33a\/e58\/34333ae583cbef22aaec7afc647b181e.png\" width=\"812\" height=\"502\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/343\/33a\/e58\/34333ae583cbef22aaec7afc647b181e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043b\u043e\u0433\u0438 \u0432 LamdaTest Automation Dashboard.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b8a\/110\/00b\/b8a11000ba6e6bde17d6dc365fc89db4.png\" width=\"1710\" height=\"769\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b8a\/110\/00b\/b8a11000ba6e6bde17d6dc365fc89db4.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 TestNG \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0438 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435<\/h3>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043a\u0435\u0439\u0441\u0430 \u0432 TestNG \u0438 \u043a\u0430\u043a \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 TestNG \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0438\u0445 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0438\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043d\u0435 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u043c\u043e\u0433\u0443\u0442 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/www.lambdatest.com\/blog\/create-testng-xml-file-execute-parallel-testing\/\"><u>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 XML-\u0444\u0430\u0439\u043b\u0430 TestNG<\/u><\/a> \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 TestNG \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c XML-\u0444\u0430\u0439\u043b\u0430 TestNG.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u043e\u0442 \u0436\u0435 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441, \u0433\u0434\u0435 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0442.\u0435. 0, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0438\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<pre><code class=\"java\">package LamdaTest;  import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.Reporter; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test;  import java.net.MalformedURLException; import java.net.URL;  class SeleniumPlaygroundTestsWithoutPriority {      public String username = \"YOUR USERNAME\";    public String accesskey = \"YOUR ACCESSKEY\";    public static RemoteWebDriver driver = null;    public String gridURL = \"@hub.lambdatest.com\/wd\/hub\";     @BeforeClass    public void setUp() throws Exception {        DesiredCapabilities capabilities = new DesiredCapabilities();        capabilities.setCapability(\"browserName\", \"chrome\");        capabilities.setCapability(\"version\", \"94.0\");        capabilities.setCapability(\"platform\", \"win10\"); \/\/ If this cap isn't specified, it will just get the any available one        capabilities.setCapability(\"build\", \"TestNGWithoutPriorityTests\");        capabilities.setCapability(\"name\", \"TestNGWithoutPriorityTestsSample\");        try {            driver = new RemoteWebDriver(new URL(\"https:\/\/\" + username + \":\" + accesskey + gridURL), capabilities);        } catch (MalformedURLException e) {            System.out.println(\"Invalid grid URL\");        } catch (Exception e) {            System.out.println(e.getMessage());        }        Reporter.log(\"Logging into Selenium Playground\", true);        driver.get(\"http:\/\/labs.lambdatest.com\/selenium-playground\/\");    }     @Test    public void getFirstOptionName() {        try {            WebElement option1 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[1]\"));            Reporter.log(\"The First Option Is: \" + option1.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getSecondOptionName() {        try {            WebElement option2 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[2]\"));            Reporter.log(\"The Second Option Is: \" + option2.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getThirdOptionName() {        try {            WebElement option3 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[3]\"));            Reporter.log(\"The Third Option Is: \" + option3.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getFourthOptionName() {        try {            WebElement option4 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[4]\"));            Reporter.log(\"The Fourth Option Is: \" + option4.getText(), true);        } catch (Exception e) {         }     }      @Test    public void getFifthOptionName() {        try {            WebElement option5 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[5]\"));            Reporter.log(\"The Fifth Option Is: \" + option5.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getSixthOptionName() {        try {            WebElement option6 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[6]\"));            Reporter.log(\"The Sixth Option Is: \" + option6.getText(), true);        } catch (Exception e) {         }     }     @AfterClass    public void closeBrowser() {        driver.close();        Reporter.log(\"Closing the browser\", true);     }  }<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c \u043d\u0438\u0436\u0435 \u0444\u0430\u0439\u043b\u043e\u043c testng.xml \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u043e\u0442 \u0436\u0435 \u043a\u043b\u0430\u0441\u0441 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 thread-count 6.<\/p>\n<pre><code class=\"java\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?> &lt;!DOCTYPE suite SYSTEM \"http:\/\/testng.org\/testng-1.0.dtd\"> &lt;suite  name=\"TestNGPriorityTest\" parallel=\"methods\" thread-count=\"6\" >     &lt;test name=\"TestNGPriorityTest\">        &lt;classes>            &lt;class name=\"LamdaTest.SeleniumPlaygroundTestsWithoutPriority\">            \/class>        &lt;\/classes>    &lt;\/test> &lt;\/suite><\/code><\/pre>\n<p><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0432 \u0438\u0434\u0435\u0430\u043b\u0435, \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u043e\u043d\u0438 \u0438\u043c\u0435\u043b\u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 0. \u0422\u0430\u043a, <code>getFifthOptionName<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c, \u0437\u0430\u0442\u0435\u043c <code>getFirstOptionName<\/code> \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e70\/2be\/c26\/e702bec26c622865424b4b023cad00d6.png\" width=\"735\" height=\"457\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e70\/2be\/c26\/e702bec26c622865424b4b023cad00d6.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0447\u0438\u0442\u0430\u0439\u0442\u0435: <a href=\"https:\/\/www.lambdatest.com\/blog\/speed-up-automated-parallel-testing-in-selenium-with-testng\/\"><u>Speed Up Automated Parallel Testing In Selenium With TestNG<\/u><\/a><\/p>\n<p><strong>\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/strong><\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0430 \u043d\u0435 \u0432 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u0431\u044b\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e19\/7ef\/979\/e197ef979c77628a3e29a6a5709bf892.png\" width=\"1001\" height=\"673\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e19\/7ef\/979\/e197ef979c77628a3e29a6a5709bf892.png\"\/><figcaption><\/figcaption><\/figure>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/strong>: \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u0430\u043b\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b parallel \u0438 thread-count \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 testng.xml.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u0443\u0447\u0435\u0441\u0442\u044c, \u0447\u0442\u043e \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442. \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430\u043c\u0438 \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0431\u043b\u043e\u0433\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438 \u043e\u0431 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 \u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 (Priority) \u0432 TestNG \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Selenium.<\/p>\n<p>\u041c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u043a\u0430\u043a TestNG \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0438 \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c TestNG, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e Selenium TestNG \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u0438 \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG.<\/p>\n<p>\u0423\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f!<\/p>\n<hr\/>\n<blockquote>\n<p>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/Lfsl\/\">\u00abJava QA Engineer. Professional\u00bb<\/a>.<\/p>\n<p>\u0412\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0434\u0432\u0443\u0445\u0434\u043d\u0435\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432 <strong>\u00ab\u0421\u043b\u043e\u0436\u043d\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0438, \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438 (listeners), \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f?\u00bb<\/strong>. \u041d\u0430 \u0437\u0430\u043d\u044f\u0442\u0438\u0438 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u0138\u0438 &lt;T>, \u0444\u0443\u043d\u0138\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0438 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438 (listeners). \u0423\u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u0138\u043e\u0435, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0438 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438, \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f, \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u0138\u0443, EventFiringDriver \u0438 \u043f\u0440\u0430\u0138\u0442\u0438\u0138\u0430. <\/p>\n<p>\u2192 <a href=\"https:\/\/otus.pw\/tLTZ\/\"><strong>\u0420\u0415\u0413\u0418\u0421\u0422\u0420\u0410\u0426\u0418\u042f<\/strong> <\/a><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/588466\/\"> https:\/\/habr.com\/ru\/articles\/588466\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>TestNG \u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430<a href=\"https:\/\/www.lambdatest.com\/automation-testing\"><u> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/u><\/a> \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u0432 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0432 TestNG \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0445 \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432 \u0438\u043b\u0438 \u0432\u044b \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0432\u0445\u043e\u0434\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0432\u0430\u0440\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 TestNG \u0432\u0441\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0431\u043b\u043e\u0433\u0430\u0445 \u044d\u0442\u043e\u0439 <a href=\"https:\/\/www.lambdatest.com\/learning-hub\/testng\"><u>\u0441\u0435\u0440\u0438\u0438 \u0443\u0440\u043e\u043a\u043e\u0432 \u043f\u043e Selenium TestNG <\/u><\/a>\u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438, <a href=\"https:\/\/www.lambdatest.com\/blog\/how-to-install-testng-in-eclipse-step-by-step-guide\/\"><u>\u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c TestNG<\/u><\/a>, <a href=\"https:\/\/www.lambdatest.com\/blog\/complete-guide-on-testng-annotations-for-selenium-webdriver\/\"><u>\u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0432 TestNG<\/u><\/a> \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u0412 \u044d\u0442\u043e\u043c \u0431\u043b\u043e\u0433\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Selenium.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c!<\/p>\n<p><strong>\u0421\u041e\u0414\u0415\u0420\u0416\u0410\u041d\u0418\u0415<\/strong><\/p>\n<ol>\n<li>\n<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG?<\/p>\n<\/li>\n<li>\n<p>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Selenium?<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 TestNG \u043f\u0440\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c<\/p>\n<\/li>\n<\/ol>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG?<\/h3>\n<p>\u0412 TestNG \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u2014 \u044d\u0442\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d\u0438 \u0445\u043e\u0442\u044f\u0442, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u044b.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432 \u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 (Priority) \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG. \u0422\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u0432, \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u044b \u0441 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c\u0438.<\/p>\n<h3>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e @Test (priority=X). \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043b\u0438 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0443 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 1.<\/p>\n<pre><code class=\"java\">@Test(priority = 1) public void myTestCaseWithPriority() {    try {        System.out.println(\"I am in my first testcase with priority=1\");    } catch (Exception e) {    } }<\/code><\/pre>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 TestNG?<\/h3>\n<p>\u041f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 TestNG \u0440\u0430\u0432\u0435\u043d 0. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG \u0434\u043b\u044f \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u043e\u0432, TestNG \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 0.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0438\u0436\u0435 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u043d\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u043c\u0443 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 0.<\/p>\n<pre><code class=\"java\">@Test public void myTestCaseWithDefaultPriority() {    try {        System.out.println(\"I am in my first testcase with default priority\");    } catch (Exception e) {      } }<\/code><\/pre>\n<p>\u0421 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 TestNG \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043d\u0430\u0432\u044b\u043a\u0438 \u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e TestNG \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u044e \u043a\u0430\u0440\u044c\u0435\u0440\u0443 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 TestNG \u043e\u0442 LambdaTest:<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/618bdeabcd09f7f6552eb409\" data-style=\"\" id=\"618bdeabcd09f7f6552eb409\" width=\"\"><\/div>\n<h3>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0432 TestNG?<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0434\u0430\u0435\u0442\u0435\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043b\u044e\u0431\u043e\u043c\u0443 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0443, \u0442\u043e \u043e\u0442\u0432\u0435\u0442 \u2014 \u0414\u0430! \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u043a\u043e\u0433\u0434\u0430 \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0438\u043c\u0435\u043b\u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043d\u0430\u0434 \u0442\u0435\u043c\u0438, \u0447\u0442\u043e \u0441\u0442\u043e\u044f\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 0, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0442.\u0435. -1. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u0435\u0442\u043e\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c, \u0430 \u0437\u0430\u0442\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<pre><code class=\"java\">@Test public void myTestCaseWithDefaultPriority() {    try {        System.out.println(\"I am in my first testcase with default priority\");    } catch (Exception e) {      }   }   @Test(priority = -1) public void myTestCaseWithNegativePriority() {    try {        System.out.println(\"I am in my first testcase with negative priority\");    } catch (Exception e) {      }   }<\/code><\/pre>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0447\u0442\u0438\u0442\u0435: <a href=\"https:\/\/www.lambdatest.com\/blog\/how-to-use-dataproviders-in-testng-with-examples\/\"><u>How To Use DataProviders In TestNG [With Examples]<\/u><\/a><\/p>\n<h3>\u041a\u0430\u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0432 TestNG?<\/h3>\n<p>\u0412\u0430\u043c \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0441\u0435 \u0438\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 TestNG \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u043e\u043c\u0443 \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u043f\u0440\u0438 \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0442\u0435\u0441\u0442-\u043c\u0435\u0442\u043e\u0434\u0430 (a \u0438 b), \u0438 \u043e\u0431\u0430 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0440\u0430\u0432\u043d\u044b\u0439 0. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c: \u043c\u0435\u0442\u043e\u0434 a, \u0430 \u0437\u0430\u0442\u0435\u043c b.<\/p>\n<pre><code class=\"java\">@Test public void a() {    try {        System.out.println(\"A\");    } catch (Exception e) {      }   }   @Test public void b() {    try {        System.out.println(\"B\");    } catch (Exception e) {      }   }<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0447\u0442\u0438\u0442\u0435: <a href=\"https:\/\/www.lambdatest.com\/blog\/parameterization-in-testng-dataprovider-and-testng-xml-examples\/\">Parameterization In TestNG \u2013 DataProvider and TestNG XML (With Examples)<\/a><\/p>\n<h3>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Selenium?<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0431\u043b\u043e\u0433\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u043c\u044b \u0438\u0437\u0443\u0447\u0438\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u044b \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0432 TestNG. \u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e Selenium TestNG \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442\u0430 \u0432 TestNG \u0438\u043b\u0438 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG.<\/p>\n<p>\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<p>\u041c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <a href=\"http:\/\/labs.lambdatest.com\/selenium-playground\/\"><u>Selenium Playground<\/u><\/a>, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u0443\u044e LambdaTest, \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432.<\/p>\n<p>LambdaTest \u2014 \u044d\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 <a href=\"https:\/\/www.lambdatest.com\/feature\"><u>\u043a\u0440\u043e\u0441\u0441\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/u><\/a>. \u0418\u043c\u0435\u044f \u0432 \u0441\u0432\u043e\u0435\u043c \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0435 \u0431\u043e\u043b\u0435\u0435 2000 <a href=\"https:\/\/www.lambdatest.com\/virtual-browsers\"><u>\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u0432 <\/u><\/a>\u0438 \u041e\u0421, \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0443\u0447\u043d\u044b\u043c\u0438 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/p>\n<p>\u041c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043d\u0438\u0436\u0435:<\/p>\n<ul>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u0438 \u0431\u0435\u0437 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 TestNG \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<a href=\"https:\/\/www.lambdatest.com\/blog\/selenium-webdriver-tutorial-with-examples\/\"><u> Selenium WebDriver<\/u><\/a>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0431\u043b\u043e\u0433\u0443 <a href=\"https:\/\/www.lambdatest.com\/blog\/create-testng-project-in-eclipse-run-selenium-test-script\/\"><u>\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 TestNG \u0432 Eclipse \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f Selenium Test.<\/u><\/a><\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u0432 TestNG<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e Selenium TestNG \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0442\u0435\u0441\u0442-\u043a\u0435\u0439\u0441\u0430 \u0432 TestNG, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 Selenium.<\/p>\n<pre><code class=\"java\">package LamdaTest; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.Reporter; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import java.net.MalformedURLException; import java.net.URL;  class SeleniumPlaygroundTestsWithoutPriority {      public String username = \"YOUR USERNAME\";    public String accesskey = \"YOUR ACCESSKEY\";    public static RemoteWebDriver driver = null;    public String gridURL = \"@hub.lambdatest.com\/wd\/hub\";     @BeforeClass    public void setUp() throws Exception {        DesiredCapabilities capabilities = new DesiredCapabilities();        capabilities.setCapability(\"browserName\", \"chrome\");        capabilities.setCapability(\"version\", \"94.0\");        capabilities.setCapability(\"platform\", \"win10\"); \/\/ If this cap isn't specified, it will just get the any available one        capabilities.setCapability(\"build\", \"TestNGWithoutPriorityTests\");        capabilities.setCapability(\"name\", \"TestNGWithoutPriorityTestsSample\");        try {            driver = new RemoteWebDriver(new URL(\"https:\/\/\" + username + \":\" + accesskey + gridURL), capabilities);        } catch (MalformedURLException e) {            System.out.println(\"Invalid grid URL\");        } catch (Exception e) {            System.out.println(e.getMessage());        }        Reporter.log(\"Logging into Selenium Playground\", true);        driver.get(\"http:\/\/labs.lambdatest.com\/selenium-playground\/\");    }     @Test    public void getFirstOptionName() {        try {            WebElement option1 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[1]\"));            Reporter.log(\"The First Option Is: \" + option1.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getSecondOptionName() {        try {            WebElement option2 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[2]\"));            Reporter.log(\"The Second Option Is: \" + option2.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getThirdOptionName() {        try {            WebElement option3 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[3]\"));            Reporter.log(\"The Third Option Is: \" + option3.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getFourthOptionName() {        try {            WebElement option4 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[4]\"));            Reporter.log(\"The Fourth Option Is: \" + option4.getText(), true);        } catch (Exception e) {         }     }      @Test    public void getFifthOptionName() {        try {            WebElement option5 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[5]\"));            Reporter.log(\"The Fifth Option Is: \" + option5.getText(), true);        } catch (Exception e) {         }     }     @Test    public void getSixthOptionName() {        try {            WebElement option6 = driver.findElement(By.xpath(\"(\/\/div[@class='contentlearn']\/\/h2)[6]\"));            Reporter.log(\"The Sixth Option Is: \" + option6.getText(), true);        } catch (Exception e) {         }     }     @AfterClass    public void closeBrowser() {        driver.close();        Reporter.log(\"Closing the browser\", true);     }  }<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u0444\u0430\u0439\u043b testng.xml \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<pre><code class=\"java\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?> &lt;!DOCTYPE suite SYSTEM \"http:\/\/testng.org\/testng-1.0.dtd\"> &lt;suite  name=\"TestNGPriorityTest\">     &lt;test name=\"TestNGPriorityTest\" >        &lt;classes>            &lt;class name=\"LamdaTest.SeleniumPlaygroundTestsWithoutPriority\">            &lt;\/class>        &lt;\/classes>    &lt;\/test> &lt;\/suite><\/code><\/pre>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 pom.xml \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<pre><code class=\"java\">&lt;?xml version=\"1.0\"<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-399125","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/399125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=399125"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/399125\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=399125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=399125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=399125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}