{"id":19114,"date":"2019-03-04T15:54:52","date_gmt":"2019-03-04T15:54:52","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=19114"},"modified":"2024-08-09T06:56:48","modified_gmt":"2024-08-09T06:56:48","slug":"how-to-enable-network-logs-to-selenium-cloud-tests","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/how-to-enable-network-logs-to-selenium-cloud-tests\/","title":{"rendered":"How to enable Network Logs to Selenium Cloud Tests?"},"content":{"rendered":"<h2>How to enable Network Logs to Selenium Cloud Tests?<\/h2>\n<p>In this tutorial, we will learn the steps to enable Network logs to Selenium Cloud Tests using LambdaTest cloud service.<\/p>\n<h3>Tools used<\/h3>\n<p>Tools and services used in this tutorial:<\/p>\n<ul>\n<li>Latest Selenium Webdriver for Java<\/li>\n<li>LambdaTest Cloud Service.<\/li>\n<li>Eclipse IDE, TestNG Framework<\/li>\n<\/ul>\n<h3>Network Logs<\/h3>\n<p>Automation logs enable the Engineer or Tester to know more information or to debug automation test failures. QA Lab tests mostly do not involve network factor when we run tests on local QA Selenium Grid, or on in-house staging environment grids.<\/p>\n<p>In reality, production environment where the web app lives involves network payload between the web app and the end user. So, its important to know or enable network logs during the tests.<\/p>\n<h3>Enable Network Logs<\/h3>\n<p>When network logs are not set to the automation capabilities, we can notice empty network tabs in the automation logs.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-19124\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Empty-Network-Tab-Cloud.png\" alt=\"Empty Network Tab Cloud\" width=\"1419\" height=\"840\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Empty-Network-Tab-Cloud.png 1419w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Empty-Network-Tab-Cloud-300x178.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Empty-Network-Tab-Cloud-1024x606.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Empty-Network-Tab-Cloud-768x455.png 768w\" sizes=\"auto, (max-width: 1419px) 100vw, 1419px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>It is simple to enable network logging with <strong>DesiredCapabilities(). <\/strong>We can set flags to enable console, network, visual and video logs for the cloud tests.<\/p>\n<p>Sample code listing to enable logs to the cloud test:<\/p>\n<pre>\tDesiredCapabilities capabilities = new DesiredCapabilities();\r\n\t\tcapabilities.setCapability(\"platform\", \"Windows 10\");\r\n\t\tcapabilities.setCapability(\"browserName\", \"Chrome\");\r\n\t\tcapabilities.setCapability(\"version\", \"87.0\"); \r\n\t\tcapabilities.setCapability(\"resolution\",\"1024x768\");\r\n\t\tcapabilities.setCapability(\"build\", \"TestingDocs\r\n Test\");\r\n\t\tcapabilities.setCapability(\"name\", \"Sample Test\r\n with Logs enabled\");\r\n\t\tcapabilities.setCapability(\"network\", true); \/\/ This\r\n is to enable network logs\r\n\t\tcapabilities.setCapability(\"visual\", true); \/\/ This \r\nis to enable screenshots\r\n\t\tcapabilities.setCapability(\"video\", true); \/\/ This\r\n is to enable video recording\r\n\t\tcapabilities.setCapability(\"console\", true); \/\/ This\r\n is to capture console logs\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-19118 size-full\" title=\"Selenium Cloud Tests\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Enable-Network-Logs-Selenium.png\" alt=\"Enable Network Logs Selenium\" width=\"1726\" height=\"863\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Enable-Network-Logs-Selenium.png 1726w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Enable-Network-Logs-Selenium-300x150.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Enable-Network-Logs-Selenium-1024x512.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Enable-Network-Logs-Selenium-768x384.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Enable-Network-Logs-Selenium-1536x768.png 1536w\" sizes=\"auto, (max-width: 1726px) 100vw, 1726px\" \/><\/p>\n<h3>Verification<\/h3>\n<p>Cloud test run using the capabilities set will display the automation logs. Log on to the LambdaTest cloud service account.<\/p>\n<p>Click on the <strong>Automation Dashboard<\/strong>.<\/p>\n<p>Select the automation tests that have logs enabled.<\/p>\n<p>Check the <strong>Automation Logs &gt;&gt; Network tab<\/strong>.<\/p>\n<p>We can now check the logs for different components of the web application.<\/p>\n<ul>\n<li>JavaScript<\/li>\n<li>Images<\/li>\n<li>CSS, etc<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-19119 size-full\" title=\"Automation Logs Network\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Automation-Logs-Network.png\" alt=\"Automation Logs Network\" width=\"1613\" height=\"887\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Automation-Logs-Network.png 1613w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Automation-Logs-Network-300x165.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Automation-Logs-Network-1024x563.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Automation-Logs-Network-768x422.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Automation-Logs-Network-1536x845.png 1536w\" sizes=\"auto, (max-width: 1613px) 100vw, 1613px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>LambdaTest is a cloud based a <strong>SaaS <\/strong>(Software as a Service) platform, To know more information visit the official website:<\/p>\n<p><strong><a href=\"https:\/\/www.lambdatest.com\/\" rel=\"noopener\">https:\/\/www.lambdatest.com\/<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to enable Network Logs to Selenium Cloud Tests? In this tutorial, we will learn the steps to enable Network logs to Selenium Cloud Tests using LambdaTest cloud service. Tools used Tools and services used in this tutorial: Latest Selenium Webdriver for Java LambdaTest Cloud Service. Eclipse IDE, TestNG Framework Network Logs Automation logs enable [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[185],"tags":[214],"class_list":["post-19114","post","type-post","status-publish","format-standard","hentry","category-selenium","tag-selenium","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/19114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=19114"}],"version-history":[{"count":14,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/19114\/revisions"}],"predecessor-version":[{"id":23737,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/19114\/revisions\/23737"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=19114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=19114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=19114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}