GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Mindmap

Selenium

Alejandra Neolopan Englisch

Inhalt der Mindmap

Selenium

  1. It is a open-source testing framework for Web applciations

    • contain Tools & APIS
  2. Kind of

    • Selenium IDE
      • It is a Firefox plugin
        • Goal: Record and play actions
    • Selenium RC
      • A client/server system for execute tests in different languages. It is deprecated.
    • Selenium WebDriver
      • This actually provide the tools, libraries, drivers for support in programming languages in order to automate actions
        • Driver
          • functions to control browser
    • Selenium GRID
      • It let run automation remotely in all browsers.
  3. Locators

    • Attributes-based
      • By.id
        • Find an element by id, it is the first choice, id is unique: <div id="toolbar">.....</div>
          • WebElement Ele = driver.findElement(By.id("toolbar"));
      • By.name
        • Find an element by name attribute, as long as it is unique: <input name="register" class="required" type="text"/>
          • WebElement register= driver.findElement(By.name("register"));
      • By.linkText
        • Find a element by link text: <a href="http://www.seleniumhq.org">Downloads</a>
          • WebElement download = driver.findElement(By.linkText("Downloads"));
      • By Partial LinkText
        • Same to Link Text, including <anchor> tag
      • By TagName
        • TagName can be used with Group elements like , Select and check-boxes / dropdowns
      • By.className
        • Find elements by class attribute
    • Structure-based
      • XPath
        • It is a standard navigation tool for XML, HTML document is also an XML document (xHTML)
          • Native Xpath
            • html/head/body/table/tr/td
          • Relative Xpath
            • Find an image: xpath=//img[@alt='image alt text']
            • Get an cell element: xpath=//table[@id='table1']//tr[4]/td[2] xpath=(//table[@class='nice'])//th[text()='headertext']/
            • Link element: xpath=//a[contains(@href,'href goes here')]
            • Input element: xpath=//input[@name='name2' and @value='yes']
              • or xpath =//*[@name='name2']
        • How can I create an xpath locator?
          • 1. Firebug tool ==> Native XPath, absolute path
          • 2. FirePath tool ==> Relative XPath
          • 3. Mix both: New relative xpath: //body//footer/section[3]/div/ul/li[3]/a Another relative xpath: //body//section[3]/div/ul/li[3]/a
          • 4. Containing a Keyword: link picture with profile keyword: //img[contains(@src,’Profile’)]
          • 5. Start with a keyword: picture alt with the keyword: //img[starts-with(@alt,’Visit Us On Linkedin’)]
          • 6. find a text: //*[text() = 'something'], //a[contains(text(), 'part link name')]
      • CssSelector
  4. Wait commands

    • Explicit waits
      • more user-controlled approach. Set a timeout specific for another elements.
        • WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.elementToBeClickable(downloadLink));
          • presenceOfElementLocated – Waits for an element to be present in the DOM; returns the WebElement visibilityOfElementLocated – Waits for an element to be visible; returns true if the element is visible invisibilityOfElementLocated – Waits for an element to be invisible; returns true if the element is not visible elementToBeClickable – Waits for element to be clickable, i.e., visible and enabled; returns the WebElement alertIsPresent – Waits for an alert to be present; returns the alert if present titleIs – Waits for the title to match a specific value elementSelectionStateToBe – Waits for an element to be selected or not frameToBeAvailableAndSwitchToIt – Waits for a frame to be available and switches to it so we can interact with the contents of the frame titleContains – Waits for the title to contain a String; returns true when title matches urlContains – Waits for the URL to contain a specific String urlMatches – Waits for the URL to match a specific regular expression urlToBe – Waits for the URL to be an exact String
    • Implicit waits
      • WebDriver will: try to find it, fail,
        • instead of throwing a NoSuchElementException exception, WebDriver will wait for 500 milliseconds, then WebDriver will try to find it again
      • It is configured by using the manage timeouts functionality from the WebDriver API.
        • driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

Informationen

Beschreibung
Mindmap am Selenium, erstellt von Alejandra Neolopan am 05/04/2016.
Erstellt von
Alejandra Neolopan
Aufrufe
1
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck