Run time sendkeys in Selenium

  • 28
    Dec

    Run time sendkeys in Selenium

    -For the number pad addition key. driver.FindElement(By.XPath(“String”)).SendKeys(Keys.Add); -For  the Alt key. driver.FindElement(By.XPath(“String”)).SendKeys(Keys.Alt); -For  the Left arrow key. driver.FindElement(By.XPath(“String”)).SendKeys(Keys.ArrowDown); -For  the left arrow key. driver.FindElement(By.XPath(“String”)).SendKeys(Keys.ArrowLeft); -For  the right arrow key....

    Read More
  • 26
    Dec

    Configure Timeout duration for TestNG testmethods

    TestNG allows user to configure a time period to wait for a test to completely execute. Timeout can be configured in two ways: #1. At TestMethod level: @Test(timeout=500) public...

    Read More
  • 26
    Dec

    Short notes to understand different TestNG annotations

    Annotation | Syntax | Description —————————————————————————————————————————————– @BeforeSuite | public void | The method will be run only once, before all the tests in the suite are executed. @BeforeGroups |...

    Read More
  • 26
    Dec

    Selective and Prioritized testmethod execution with TestNG

    TestNG provides features to allow selective execution of testcases based on userdefined priority. Sometimes we do not need to execute all test methods as defined in multiple test classes....

    Read More
  • 26
    Dec

    Handling Exceptions without using try/catch block with TestNG

    Like any programming language, our test cases need to be sturdy and capable to handle unexpected conditions as much as possible. e.g. While creating a temp file on detachable...

    Read More
  • 26
    Dec

    Execute selective test case to meet test requirements

    While testing it is necessary to execute “Sanityonly” test cases. e.g. As soon as build is ready, run only “sanity test cases” to validate stability of build. TestNG allows...

    Read More
  • 26
    Dec

    Ways to Interact with Flash objects in Selenium

    #1. Interact with Flash objects based on element location: If your script can locate the x,y coordinates of an element, you can click it using selenium ACTION class as...

    Read More
  • 20
    Dec

    BDD Advantages and Disadvantages

    BDD advantages and disadvantages The main BDD advantages are: Reduce waste: BDD is focused on discovering and developing features that brings high business value, so any feature that does...

    Read More
  • 20
    Dec

    Check if given IP address is IPv4 or IPv6

    Library function that can be used to determine if the network address shared is IPv4 or IPv6   ==== package testCases; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; public class...

    Read More
  • 20
    Dec

    Get connection interface details from your system

    Following program lists “Display name” and “InetAddress” to all network connections available   ============= package testCases; import java.io.*; import java.net.*; import java.util.*; import static java.lang.System.out; public class ListNets {...

    Read More