Posts

Technologies - TestNG Framework - Listeners (TBD)

Technologies - TestNG Framework - Reporting -TBD

Technologies - TestNG Framework - Annotation attributes

  Annotation Attributes - methods of annotations Attributes are keywords that modify the annotation's function.   alwaysrun:                 If set to true, this test method will always be run even if it depends on a method that failed. dataProvider   The name of the data provider for this test method. dataProviderClass           The class where to look for the data provider. If not specified, the data provider will be looked on the class of the current test method or one of its base classes. If this attribute is specified, the data provider method needs to be static on the specified class. dependsOnGroups   The list of groups this method depends on. dependsOnMethods            The list of methods this method depends -Non dependent @test will be executed in Ascii order followed by dependent tests - when a single test is dependent on multiple tests then ...

Technologies - TestNG Framework - Annotations

  List of annotations that TestNG supports: Annotations - are default Interfaces in TestNG @BeforeSuite  The annotated method will be run only once before all tests in this suite have run.   @AfterSuite  The annotated method will be run only once after all tests in this suite have run.   @BeforeClass  The annotated method will be run only once before the first test method in the current class is invoked.   @AfterClass  The annotated method will be run only once after all the test methods in the current class have run.   @BeforeTest  The annotated method will be run before any test method belonging to the classes inside the <test> tag is run.   @AfterTest  The annotated method will be run after all the test methods belonging to the classes inside the <test> tag have run.   @BeforeGroups  The list of groups that this configuration method will run before. This method ...

Selenium - Syncronization

  Synchronization 1.Implicit wait - Global wait and is applied to each Test Step of Test case – Maximum time limit to wait – implicit wait does not catch any performance errors and makes the test execution slow – implicit wait waits up to max timeout specified before throwing any exception. Driver.manage().timeouts().implicitlyWait(10, Timeunit.MILLISECONDS)   2.Explicit wait –Applied to specific Element of a page – Explicit wait is specific to test scenario – doesn’t affect the test execution speed WebDriverWait –> uses built in wait methods Monitors the DOM until Timeout or till the object is found within the specified time   webDriverWait w=new webDriverWait(driver, 10) Fluent Wait -> need to build customized wait methods based on the condition to be met Monitors DOM by polling at regular intervals defined by polling duration time 3.Thread.sleep

Java - URL Connection Test

  HttpURLConnection conn=(HttpURLConnection) new URL( "http://novice-2-professional.blogspot.com/2018/02/testing-process-quick-refresh.html" ).openConnection( )              conn.setRequestMethod( "HEAD" );              conn.connect();              int responseCode = conn.getResponseCode();

Selenium - Screenshots

  File srcFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);             File destFile= new File( "/com.SeleniumPractise/Snaps" );             FileUtils.copyFile(srcFile, destFile);