Wednesday, March 9, 2016

Methods or Commands, Interfaces

3/9/2016:
  • setUp
  • setproperty
  • getText() ---- webElementobj.findElementByXpath("locator ").getText()
  • get()
  • switchTo()
          When you are dealing with pop ups, alerts and dialog boxes - it means you are working on new           windows, so handle such windows we use switchTo() method.

           //Here we are dismissing the alert box that is getting generated
           Alert alertobj = webElementobj.switchTo().alert();  //How does it know which alert box???
           alertobj.dismiss();


Useful link for list of Methods and Commands:

http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/WebDriver.html

Method:



  • get

    void get(java.lang.String url)
    Load a new web page in the current browser window. This is done using an HTTP GET operation, and the method will block until the load is complete. This will follow redirects issued either by the server or as a meta-redirect from within the returned HTML. Should a meta-redirect "rest" for any duration of time, it is best to wait until this timeout is over, since should the underlying page change whilst your test is executing the results of future calls against this interface will be against the freshly loaded page. Synonym for WebDriver.Navigation.to(String).
    Parameters:
    url - The URL to load. It is best to use a fully qualified URL
  • getCurrentUrl

    java.lang.String getCurrentUrl()
    Get a string representing the current URL that the browser is looking at.
    Returns:
    The URL of the page currently loaded in the browser
  • getTitle

    java.lang.String getTitle()
    The title of the current page.
    Returns:
    The title of the current page, with leading and trailing whitespace stripped, or null if one is not already set
  • findElements

    java.util.List<WebElement> findElements(By by)
    Find all elements within the current page using the given mechanism. This method is affected by the 'implicit wait' times in force at the time of execution. When implicitly waiting, this method will return as soon as there are more than 0 items in the found collection, or will return an empty list if the timeout is reached.
    Specified by:
    findElements in interface SearchContext
    Parameters:
    by - The locating mechanism to use
    Returns:
    A list of all WebElements, or an empty list if nothing matches
    See Also:
    By, WebDriver.Timeouts
  • findElement

    WebElement findElement(By by)
    Find the first WebElement using the given method. This method is affected by the 'implicit wait' times in force at the time of execution. The findElement(..) invocation will return a matching row, or try again repeatedly until the configured timeout is reached. findElement should not be used to look for non-present elements, use findElements(By) and assert zero length response instead.
    Specified by:
    findElement in interface SearchContext
    Parameters:
    by - The locating mechanism
    Returns:
    The first matching element on the current page
    Throws:
    NoSuchElementException - If no matching elements are found
    See Also:
    By, WebDriver.Timeouts
  • getPageSource

    java.lang.String getPageSource()
    Get the source of the last loaded page. If the page has been modified after loading (for example, by Javascript) there is no guarantee that the returned text is that of the modified page. Please consult the documentation of the particular driver being used to determine whether the returned text reflects the current state of the page or the text last sent by the web server. The page source returned is a representation of the underlying DOM: do not expect it to be formatted or escaped in the same way as the response sent from the web server. Think of it as an artist's impression.
    Returns:
    The source of the current page
  • close

    void close()
    Close the current window, quitting the browser if it's the last window currently open.
  • quit

    void quit()
    Quits this driver, closing every associated window.
  • getWindowHandles

    java.util.Set<java.lang.String> getWindowHandles()
    Return a set of window handles which can be used to iterate over all open windows of this WebDriver instance by passing them to switchTo().WebDriver.Options.window()
    Returns:
    A set of window handles which can be used to iterate over all open windows.
  • getWindowHandle

    java.lang.String getWindowHandle()
    Return an opaque handle to this window that uniquely identifies it within this driver instance. This can be used to switch to this window at a later date
  • navigate

    WebDriver.Navigation navigate()
    An abstraction allowing the driver to access the browser's history and to navigate to a given URL.
    Returns:
    A WebDriver.Navigation that allows the selection of what to do next

  • manage

    WebDriver.Options manage()
    Gets the Option interface
    Returns:
    An option interface
    See Also:
    WebDriver.Options

    Interface:

    public interface WebDriver
    extends SearchContext
    The main interface to use for testing, which represents an idealised web browser. The methods in this class fall into three categories:
    • Control of the browser itself
    • Selection of WebElements
    • Debugging aids

    Nested Class Summary

    Nested Classes
    Modifier and TypeInterface and Description
    static interface WebDriver.ImeHandler
    An interface for managing input methods.
    static interface WebDriver.Navigation 
    static interface WebDriver.Options
    An interface for managing stuff you would do in a browser menu
    static interface WebDriver.TargetLocator
    Used to locate a given frame or window.
    static interface WebDriver.Timeouts
    An interface for managing timeout behavior for WebDriver instances.
    static interface WebDriver.Window

Sunday, February 28, 2016

help file




http://h30499.www3.hp.com/t5/Quality-Center-Support-and-News/Test-Plan-folders-export-to-Test-Lab-in-QC-10/td-p/5847823

uid: sreekanthjk9
pwd: sreekulkarni-1



Microstrategy:
https://ssointrad.dev.ipc.us.aexp.com/SSOI/request?request_type=un_logonAD&ssolang=en_US&ssobrand=AXP&TYPE=33554433&REALMOID=06-000368a5-3151-14ae-99e1-80f7cf93000f&GUID=0&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=s2pjRhdseDLXfwJox3t5IXickByeTtHSO3IkvIdcg5DH1S2InIi1fORfB95UIbB5&TARGET=$SM$https%3a%2f%2fdcentral974%2eintra%2eaexp%2ecom%2fmstrit%2fservlet%2fmstrWeb

sxkulkar
P@$$W0rd

desktop:
sxkulkar
sreekulkarni-1

Micro Strategy:
srikanthjk9
sreekulkarni-1


Bench resume/opportunities:
Pratyusha.Gunguru@cognizant.com
Theopulis




Monday, February 22, 2016

Automation Testing Approach using Selenium


2/22/2016

I was going through websites online to find out if there is any information on how Automation testing cycle goes on(what feature of Selenium to use and when while working on Automation) using Selenium.


The following website gives some insight into what I have been looking for:

http://www.mindfiresolutions.com/selenium-testing.htm

Selenium Web Testing services include:
WHY AUTOMATE?
Automated Software Testing has increased in popularity over the years. Increasing demands on quality and competitive pressures on time-to-market and budget have been some of the key drivers of test automation. Automated testing complements today’s agile software development processes and, if done well, results in faster time-to-market, operational cost savings, increased test coverage, and improved customer satisfaction. This is especially true for automated web application testing due to the constant need to be responsive in the face of a rapidly-changing ecosystem of browsers and versions.
  • Quick automation scripts facilitating bug reproduction and exploratory testing using Selenium IDE.
  • Robust regression automation targeting multiple platforms using Selenium WebDriver (successor of Selenium Remote Control).
  • Selenium test automation using the Programming Language of your choice (Java, PHP, C#, Ruby, Perl, Python) for plugging into your engineering architecture with ease.
  • Wrapping Selenium testing scripts in the Testing Framework (JUnit, TestNG, etc.) of your choice.
  • Integration with popular Java build tools Ant and Maven.
  • Customized reporting services using HTML.
  • Log generation to monitor stepwise testing.
  • Automation with data/keyword-driven & hybrid approaches.
  • Flash & database testing with Selenium 2.0
  • To optimize our selenium test suite for covering more test cases in less time we also perform grid testing by diving load into multiple machines at one time and let the execute test as indvidual machines and gris testing also make efficient in performing browser compatibility testing.

Selenium Automated Test Development Process Example:

Creating initial scripts using Selenium IDE
In the first step of test script development, we use Selenium IDE to quickly record test cases in Firefox. Combining the recording capability and in-built IDE that allows editing scripts, the initial set of test scripts are prepared in the real environment of the Application Under Test (AUT).
Script enhancement and debugging
Usually for simpler applications, HTML test cases generated from Selenium IDE using Selenese commands are good enough. But for sophisticated applications, we use Selenium RC / Selenium WebDriver to prepare automated GUI-driven test cases in preferred languages. The test cases prepared in Selenium IDE can be enhanced and programmatic verifications added. While building larger test suites, we use frameworks like Test::Unit, RSpec, etc.
Batch running and defect logging
Selenium test cases are run on Selenium RC / Selenium WebDriver or Selenium IDE itself depending on the complexity and amount of test cases. Once a defect is spotted, we log that into the bug tracking system. And the test case history is maintained to indicate defects it spotted.
Script maintenance
Every time the application undergoes major changes, the test cases undergo a corollary maintenance cycle. But even without any major changes, we schedule test script maintenance at regular intervals to improve their scope and coverage.

Thursday, January 21, 2016

Usefull links

http://voyager.deanza.edu/~mam-p/spring_2008/selenium/course-materials/patterns_locators_scripts.html
http://www.testingdiaries.com/selenium-ide-keypress-events/
https://hackage.haskell.org/package/webdriver-0.8.0.4/docs/Test-WebDriver-Capabilities.html

http://toolsqa.com/selenium-webdriver/modular-driven/
https://en.wikipedia.org/wiki/Keyword-driven_testing
https://en.wikipedia.org/wiki/Test_suite
http://www.seleniumwiki.com/software-testing/selenium-setspeed
http://www.businessdictionary.com/definition/separate-entity.html
https://en.wikipedia.org/wiki/TestNG
http://stackoverflow.com/questions/27183353/what-is-the-difference-between-absolute-and-relative-xpaths-which-is-preferred
http://thesai.org/Downloads/Volume3No3/Paper2-A_Keyword_Driven_Framework_for_Testing_Web_Applications.pdf
http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html
http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html
http://www.java2novice.com/java_interview_questions/this_super_difference/
http://www.exampler.com/testing-com/writings/automate.pdf
http://www.seleniumwiki.com/software-testing/automation-tools/selenium-captureentirepagescreenshot/
http://dictionary.reference.com/browse/contingencies
http://qeworks.com/handle-ajax-call-selenium-webdriver/
http://qeworks.com/perform-drag-and-drop-operations-using-selenium-webdriver/
http://www.questionselenium.com/2012/09/debugging-test-script.html

http://docs.seleniumhq.org/docs/02_selenium_ide.jsp#store-commands-and-selenium-variables
http://compendiumdev.co.uk/selenium/mindmap/Selenium-RC_Commands.html
http://docs.seleniumhq.org/docs/05_selenium_rc.jsp
https://groups.google.com/forum/#!topic/selenium-users/nCWc30GCIsI
http://www.tutorialspoint.com/selenium/selenium_overview.htm
http://www.questionselenium.com/2012/10/difference-between-verification-and.html
http://seleniumtwo-by-arun.blogspot.com/2013/06/135-using-navigate-back-command-to-move.html
http://www.aosabook.org/en/selenium.html
http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/HasCapabilities.html
https://groups.google.com/forum/#!msg/selenium-developers/uprTnZ2EQ9o/-pkU1Ql6qnUJ
https://en.wikipedia.org/wiki/Java_bytecode
http://junit.org/apidocs/org/junit/Test.html
http://stackoverflow.com/questions/40480/is-java-pass-by-reference-or-pass-by-value
http://stackoverflow.com/questions/7893492/is-java-really-passing-objects-by-value
http://stackoverflow.com/questions/1200621/declare-array-java
http://stackoverflow.com/questions/14156656/how-to-verify-element-present-or-visible-in-selenium-2-selenium-webdriver
https://groups.google.com/forum/#!topic/selenium-users/xkcj38KOSHw
http://stackoverflow.com/questions/22903630/how-to-perform-load-testing-using-selenium-webdriver

http://docs.oracle.com/javase/tutorial/essential/io/cl.html
 

Thursday, January 14, 2016

Framework

1/14/2016

- Datatable Driven - Excel has web elements and data used for the web element
- Keyword Driven --Excel has business component methods and respective web elements(double check)
- Hybrid level - combination of datadriven and keyword driven


Normally Framework has list of folders, so that you could categorize your code and put it in seperate folder for easy understanding.

 

Folders include in Framework:

- Allocator. Main class the execution will start with.
- RunManager. This is an excel file that has 'Yes' or 'No' for each test case.
- Datatable. This has keywords of web elements and also the test data for each web element.
- Business components. This has functional and verification components. Each component has only methods declared, for each business flow like for login, apply, logout etc. Does this have java files each with multiple classes ???
- Pageobjectclasses. This has implemented methods for the web elements in a specific page. These method names matches with the methods mentioned in the Business components.

Additional things framework will have is:
- Parallelthreadclasses
- Property configuration files