Giter Site home page Giter Site logo

paypal / selion Goto Github PK

View Code? Open in Web Editor NEW
277.0 62.0 233.0 46.94 MB

Enabling Test Automation in Java

Home Page: http://selion.io

License: Apache License 2.0

Java 90.63% Shell 0.28% HTML 2.48% CSS 1.50% JavaScript 4.43% Objective-C 0.68%
selenium java testng webdriver selenium-java selion testing framework selenium-grid ios

selion's Introduction

Build Status

Codacy Badge

Gitter

SeLion

Enabling Test Automation in Java

SeLion builds on top of TestNG and Selenium to provide a set of capabilities that get you up and running with WebDriver in a short time. It can be used for testing web and mobile applications.

  • A client module which you can add as a Maven dependency.
    • Annotation based WebDriver session management.
    • Runtime Reporter for real-time test execution status.
    • Swap out browser targets at run-time.
    • Automate native, hybrid, and web applications on iOS and Android devices.
    • and more
  • A set of TestNG compatible data providers which allow you to access test data from Excel, YAML, JSON, and XML.
  • A maven archetype for creating new SeLion based projects.
  • A customized Selenium Grid2 component.
  • A Code generator Maven plugin for generating Java "page objects" out of YAML.

Documentation

Project documentation including prerequisites, compilation, usage, and more is at http://paypal.github.io/SeLion/html/documentation.html

Create a new project using the SeLion maven archetype

mvn archetype:generate -B -DartifactId=Sample -Dversion=1.0.0 -DgroupId=com.mycompany.myproject \
 -DarchetypeGroupId=com.paypal.selion -DarchetypeArtifactId=SeLion-Archetype -DarchetypeVersion=1.2.0

Client module (includes SeLion DataProviders)

<dependency>
    <groupId>com.paypal.selion</groupId>
    <artifactId>SeLion</artifactId>
    <version>1.2.0</version>
</dependency>

SeLion-DataProviders only

<dependency>
  <groupId>com.paypal.selion</groupId>
  <artifactId>SeLion-DataProviders</artifactId>
  <version>1.2.0</version>
</dependency

SeLion Grid enhancements -- Required for local run support with the Client module

<dependency>
  <groupId>com.paypal.selion</groupId>
  <artifactId>SeLion-Grid</artifactId>
  <version>1.2.0</version>
</dependency

SeLion Code Generator Maven plugin -- Adds "page object" code generation

<plugin>
    <groupId>com.paypal.selion</groupId>
    <artifactId>SeLion-Code-Generator</artifactId>
    <version>1.2.0</version>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <basePackage>coo.foo.bar</basePackage>
    </configuration>
</plugin>

Run the SeLion Grid as a standalone selenium server

java -jar SeLion-Grid-1.2.0-jar-with-dependencies.jar

Run the SeLion Grid as a selenium hub

java -jar SeLion-Grid-1.2.0-jar-with-dependencies.jar -role hub

Run the SeLion Grid as a selenium web node

java -jar SeLion-Grid-1.2.0-jar-with-dependencies.jar -role node

Run the SeLion Grid as a Selendroid node (beta feature)

java -cp SeLion-Grid-1.2.0-jar-with-dependencies.jar com.paypal.selion.grid.SelendroidJarSpawner

Run the SeLion Grid as an ios-driver node (beta feature)

java -cp SeLion-Grid-1.2.0-jar-with-dependencies.jar com.paypal.selion.grid.IOSDriverJarSpawner

Run the SeLion Grid as an Appium node (beta feature)

java -cp SeLion-Grid-1.2.0-jar-with-dependencies.jar com.paypal.selion.grid.AppiumSpawner

Run the SeLion Grid as a Sauce labs proxy

java -cp SeLion-Grid-1.2.0-jar-with-dependencies.jar -role hub -type sauce

Contact

Feel free to ask questions and/or share ideas.

Submitting bugs and feature requests

We use GitHub for tracking issues. Please scan the list of GitHub Issues before filing a new one.

Contributing

Your contribution is welcome and appreciated!

  • Code Development is done on the develop branch.
  • Documentation is done on the gh-pages branch.
  1. Complete and return either the Personal or Corporate CLA.
  2. Make sure your ~/.gitconfig file has your full name with proper use of case as user.name and your real email address as user.email. GitHub has a nice write-up on this.
  3. Make sure you rebase off of the latest upstream version before submitting your pull request.

Areas that need contribution

  1. Project Documentation and/or Project Website.
  2. Project Tests and/or Testing.
  3. Any open item from GitHub Issues.
  4. Support for additional data formats such as CSV for data driven testing.

Projects we depend on that need contributors

Current version

1.2.0 (Selenium 2.53.x based)

Development version

2.0.0-SNAPSHOT (Selenium 3.x based)

License

Code - Apache Software License v2.0

Documentation and Site - Creative Commons Attribution 4.0 International License

selion's People

Contributors

abhilgupta avatar alizelzele avatar duaneobrien avatar elhuang avatar fakrudeen78 avatar ibugaienko avatar iliketonguyen avatar kumaravel-jayakumar avatar mach6 avatar marvindoering avatar pmpranav avatar renniechan avatar rkpaypal avatar squash-merge avatar sudhakaraperam avatar sundaramrajendran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

selion's Issues

Getting started documentation

I was going through the getting started document of Selion.
http://paypal.github.io/SeLion/html/documentation.html#getting-started

In that, the mvn command to run the test suite is given as
just mvn clean test -DsuiteXmlFile=src/test/resources/SampleSuite.xml,
but that did not help me and it was throwing some error.
I had to add -DSELION_SELENIUM_RUN_LOCALLY=true, It would be great if you can update the document with that .

mvn clean test -DsuiteXmlFile=src/test/resources/SampleSuite.xml -DSELION_SELENIUM_RUN_LOCALLY=true.

I can find it described at different parts in the documentation, but not in getting started.

Code refactoring opportunities

  • Left unaddressed from #44
  • In com.paypal.selion.platform.grid.LocalSelendroidNode the following methods are being duplicated from com.paypal.selion.platform.grid.LocalIOSNode. Can we consider creating an AbstractNode from which both LocalSelendroidNode and LocalIOSNode extend and house these two methods in the abstract class ?
    com.paypal.selion.platform.grid.LocalSelendroidNode.waitForNodeToComeUp(int)
    com.paypal.selion.platform.grid.LocalSelendroidNode.wasNodeSpawned(int)
  • In com.paypal.selion.platform.grid.LocalSelendroidNode.startSelendroidDriverNode(int) can we consider using org.apache.commons.io.filefilter.FileFilterUtils ?

Unclear documentation w.r.t defaultLocale / PageYaml

Consider rephrasing this text and/or adding an example which walk through the design details;

defaultLocale: - The default locale to use if the PageYAML does not explicitly define a locale specific 
value. For example; A value of US will require US definitions in the PageYAML but if a test is currently 
running against the German version of a site and the DE definition does not exist for the queried 
attribute, then the US version will be used.

This documentation issue is rooted in this feedback;

I interpreted the phrase from documentation "if the PageYAML does not explicitly define a locale 
specific value" as a possibility to drop "US:" key *in locator* and use just a value without prefix. I 
thought that locators without a key will get the key from defaultLocale. Perhaps the doc should be 
rephrased as "if locator does not define a locale", or maybe just replace it with example. English is not 
good enough in situation like this one. 

An example walk-through could look like this;

You only need to specify the locator for any given element in a different locale when it is different from the defaultLocale's value. When the test is run, if there is no locator specified for your target locale, the locator for the defaultLocale is used. For example;

baseClass: "com.paypal.selion.testcomponents.BasicPageImpl"
pageTitle:
  US: "API Page"
elements:
  loginTextField:
    locators:
      US: "@id='txtUsername'"
  helpPageButton:
    locators:
      US: "@id='helpPageBtn'"
      UK: "@id='uk-helpPageBtn'"
defaultLocale: "US"
pageValidators: []

In this example, if you run a test with the locale = UK, the locators @id='uk-helpPageBtn' and "@id='txtUsername'" will be used for helpPageButton and loginTextField

Error displayed in SeLIon Grid2 Node on windows

15:55:36.308 ERROR - java.io.IOException: Cannot run program "tasklist.exe /fo c
sv /nh": CreateProcess error=2, The system cannot find the file specified
com.paypal.selion.utils.process.ProcessHandlerException: java.io.IOException: Ca
nnot run program "tasklist.exe /fo csv /nh": CreateProcess error=2, The system c
annot find the file specified

Customizing the choice of artifacts as per the user requirements for a platform on SeLion-Grid

A Console to customize the choice of artifacts as per the user requirements would be useful.

There is no ability in the Auto Upgrade console page to select the nodes which the change should apply to. This means a user has to be creative if one node requires 32bit artifacts and another requires 64bit, for example.

By 'creative', it means the user is likely first shutting down the nodes the change should not apply to,
manual making the changes the download.json file, or other.

Provide alternate download.properties for the server component

When you start a a Grid node or hub, SeLion's file downloader kicks in and verifies all files in download.properties are present, and if necessary extracted.

By default, there are files downloaded which are not likely used on a unix/mac environment (IEDriver.exe, for example).

We should provide alternative download.properties and a means for the user to select the correct one per their platform. In addition, we should document the behavior of file downloader w.r.t it's role and how one can make it work for them.

Create a document that talks about using the SeLion Archetype

The Getting Started page for both Web and Mobile automation basically just deals with a quick start archetype. Since SeLion has a customized archetype available which is also published to Maven Central, we would need to create/update our documentation such that we start referring to the SeLion archetype in our getting started documentation.

Issue with building SeLion on fresh maven install

The <repositories> section of the parent POM needs to be re-written to

    <repositories>
        <repository>
            <id>central</id>
            <url>http://repo1.maven.org/maven2/</url>
        </repository>
        <repository>
            <id>forge</id>
            <url>http://repository.sonatype.org/content/groups/forge/</url>
        </repository>
    </repositories>

Long term the <repositories> section of the parent POM should go away. However, it is in place for now due to the dependency on UserAgentUtils which is not in Central

https://maven.apache.org/guides/mini/guide-central-repository-upload.html
http://blog.sonatype.com/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/#.VAZDtmRdXNI
http://blog.sonatype.com/2010/03/why-external-repos-are-being-phased-out-of-central/#.VAZDuWRdXNI

issues with documentation

started with getting-started for web project . came across below documentation issues

http://paypal.github.io/SeLion/html/documentation.html#getting-started

  • 1 The steps says the sample project will get created in the below path "src/main/com/mycompany/test" , but it actually created sample project in below path "src/main/java/com/mycompany/test"
  • 2 the steps says to go to folder {project}/src/test/resources and crate suite file . but there is no "resources" folder in that path , it need to be created , may be we need to add step "mkdir resources" before move to suite file creation step
  • 3 after creating the suite file the prompt location will be "{project}/src/test/resources" . if we try to run "mvn clean test -DsuiteXmlFile=src/test/resources/SampleSuite.xml" it will not work . for that command to work we need to move to "{project}/" folder before we run that

Selion documentaion issue in maven-surefire-plugin version

Started with getting-started for mobile automation in below link . came across below documentation issues

http://paypal.github.io/SeLion/html/documentation.html#getting-started-mobile

Found out that maven-surefire-plugin : 2.12 version which is updated the above Selion link is having the issue to run the script .

Got error "Error occurred in starting forkโ€ when I am running the script with maven-surefire-plugin : 2.12 due to the bug in (https://jira.codehaus.org/browse/SUREFIRE-870) In maven-surefire-plugin .

After I changed the version to 2.17 , I am not getting that error .

Documentation - default 'client' test suite requires chromedriver and chrome

The documentation on http://paypal.github.io/SeLion/html/documentation.html#buildingSelion does not list chromedriver and chrome as a prerequisite.

While technically, this is accurate if you do mvn -DskipTests=true or run a test suite other than the default one with mvn -DsuiteXmlFile=<a suite file in src/test/resources/suites>, it does not work per the instructions provided which will run the default test (requires Chrome - either locally or on a remote SELION_SELENIUM_HOST)

Build instruction for SeLion is not clear

I tried following http://paypal.github.io/SeLion/html/documentation.html#buildingSelion to build SeLion.
But I was blocked for multiple times.

  1. While building ios-driver for precondition, I need more clear information how to do it.
  2. After getting ios-driver ready, blocked while running
    mvn clean install -DSELION_SELENIUM_HOST=
    I always got error info like this
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] SeLion Parent POM ................................. SUCCESS [1.919s]
[INFO] SeLion Project BOM ................................ SUCCESS [0.036s]
[INFO] SeLion Client ..................................... FAILURE [30.085s]
[INFO] SeLion Grid ....................................... SKIPPED
[INFO] SeLion Code Generator Maven Mojo .................. SKIPPED
[INFO] SeLion Archetype .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.326s
[INFO] Finished at: Mon Sep 15 16:07:48 CST 2014
[INFO] Final Memory: 32M/368M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project SeLion: Execution default-test of goal org.apa
che.maven.plugins:maven-surefire-plugin:2.17:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C "C:\Java\jdk1.7.0_40\jre\bin\java -XX:MaxPermSize=128m -XX:-UseSplitVerifier -jar D:\workspace\SeLion\client\target\surefire\s
urefirebooter3754694759072562222.jar D:\workspace\SeLion\client\target\surefire\surefire2098405363173608294tmp D:\workspace\SeLion\client\target\surefire\surefi
re_07125297575698861365tmp"
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :SeLion

So last, I skip test and got it built finally.

I made a change in README about how did I build it on Windows platform.
Here's a link of my commit: bingwei@2017062

I suggest to update SeLion build document on this part.

Enhancing SeLion-Grid to be compatible with heterogenous environment

Right now a user can host a Grid and node "only" on the same platform. If the grid is on linux then all nodes must be on linux. same goes for windows and mac. This should be enhanced to multiple platforms where a user can hook up linux/mac/windows node to a grid irrespective of platforms.

Better organize content of SeLion-Grid.zip, once unzipped and running

We need to clean up the directory in this area.

  1. There are logs in the root folder and in the logs folder. Let's put them all in the same place.
  2. Config files are mixed in with logs and binaries.. Let's put them in a separate folder
  3. Downloaded content (from file downloader) also lands in the root folder. Should it too be in a separate folder?
  4. Better organize windows and non-windows entities -- put things together in sub folders based on platform?

Code-Generator: Add support for custom elements

We would like to add support for custom elements in the CodeGenerator. We would like to handle webpages that are build with ExtJS and if you look at for example their drop down list. You will see that the default implementation is not going to work.

For us to be able to use our best practices for web automation we would like to have custom element in the CodeGenerator that can handle this kind of non default behavior.

Proposed implementation:

Add a property to the Code-Generator which accepts a comma separated list of java classes. Based on the parameters we can add the imports and create getters and setters in the generated Pages. Example "com.rlux.test.elements.ExtJSSelectList,com.rlux.test.elements.ExtJSTable"

Output:

import com.rlux.test.elements.ExtJSSelectList;

private ExtJSSelectList categoryExtJSSelectList;

public ExtJSSelectList getCategoryExtJSSelectList() {
    return categoryExtJSSelectList;
}

public void setCategoryExtJSSelectList(ExtJSSelectList categoryExtJSSelectList) {
    this.categoryExtJSSelectList = categoryExtJSSelectList;
}

Any concerns for such functionality, and any feedback what to focus on if we would want to implement it?

sample execution failed with below error

Running TestSuite
10.20.2014 15:43:05.911,[1] com.paypal.selion INFO JDK Information: Java HotSpot(TM) 64-Bit Server VM from Oracle Corporation ver. 1.7.0_45
10.20.2014 15:43:05.916,[1] com.paypal.selion INFO Runtime Report : /Users/bbheemanadham/testProject/Sample/target/surefire-reports/RuntimeReporter/index.html
2014-10-20 15:43:06.465:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT
2014-10-20 15:43:06.496:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null}
2014-10-20 15:43:06.506:INFO:osjs.AbstractConnector:Started SocketConnector@localhost:4444
10.20.2014 15:43:06.506,[9] com.paypal.selion INFO Local Hub spawned
10.20.2014 15:43:07.105,[9] com.paypal.selion INFO Local node spawned
10.20.2014 15:43:07.240,[9] com.paypal.selion INFO Attached node to local hub http://localhost:4444/grid/register
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
ightweightThemeManager"]
1413837787990 addons.xpi DEBUG startup
1413837787990 addons.xpi DEBUG Skipping unavailable install location app-system-share
1413837787991 addons.xpi INFO Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to /Applications/Firefox.app/Contents/MacOS/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
1413837787991 addons.xpi INFO Mapping [email protected] to /var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions/[email protected]
1413837787991 addons.xpi DEBUG Ignoring file entry whose name is not a valid add-on ID: /var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions/webdriver-staging
1413837787992 addons.xpi DEBUG checkForChanges
1413837787998 addons.xpi DEBUG Directory state JSON differs: cache [] state [{"name":"app-global","addons":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"descriptor":"/Applications/Firefox.app/Contents/MacOS/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}","mtime":1411702628000,"rdfTime":1411702627000}}},{"name":"app-profile","addons":{"[email protected]":{"descriptor":"/var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions/[email protected]","mtime":1413837787000,"rdfTime":1413837787000}}}]
1413837788002 addons.xpi-utils DEBUG Opening XPI database /var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions.json
1413837788003 addons.xpi DEBUG New add-on [email protected] installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1413837788040 addons.xpi-utils DEBUG Make addon app-profile:[email protected] visible
1413837788041 DeferredSave.extensions.json DEBUG Save changes
1413837788041 DeferredSave.extensions.json DEBUG Save changes
1413837788041 addons.xpi DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1413837788043 addons.xpi-utils DEBUG Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1413837788043 DeferredSave.extensions.json DEBUG Save changes
1413837788043 DeferredSave.extensions.json DEBUG Save changes
1413837788047 addons.xpi DEBUG Updating database with changes to installed add-ons
1413837788047 addons.xpi-utils DEBUG Updating add-on states
1413837788048 addons.xpi-utils DEBUG Writing add-ons list
1413837788266 DeferredSave.extensions.json DEBUG Starting timer
1413837788293 DeferredSave.extensions.json DEBUG Starting write
1413837788297 addons.manager DEBUG shutdown
1413837788299 addons.xpi DEBUG shutdown
1413837788299 addons.xpi-utils DEBUG shutdown
1413837788330 DeferredSave.extensions.json DEBUG Write succeeded
1413837788330 addons.xpi-utils DEBUG XPI Database saved, setting schema version preference to 16
1413837788330 addons.xpi DEBUG Notifying XPI shutdown observers
1413837788332 addons.manager DEBUG Async provider shutdown done
1413837788532 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1413837788533 addons.manager DEBUG Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1413837788534 addons.xpi DEBUG startup
1413837788535 addons.xpi DEBUG Skipping unavailable install location app-system-share
1413837788535 addons.xpi INFO Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to /Applications/Firefox.app/Contents/MacOS/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
1413837788536 addons.xpi INFO Mapping [email protected] to /var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions/[email protected]
1413837788536 addons.xpi DEBUG Ignoring file entry whose name is not a valid add-on ID: /var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions/webdriver-staging
1413837788536 addons.xpi DEBUG checkForChanges
1413837788541 addons.xpi DEBUG No changes found
*** Blocklist::_preloadBlocklistFile: blocklist is disabled

at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:191)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:103)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:62)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:56)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:216)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:203)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:170)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

An error occured while setting up the test environment.
Root cause: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
ightweightThemeManager"]
1413837787990 addons.xpi DEBUG startup
1413837787990 addons.xpi DEBUG Skipping unavailable install location app-system-share
1413837787991 addons.xpi INFO Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to /Applications/Firefox.app/Contents/MacOS/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
1413837787991 addons.xpi INFO Mapping [email protected] to /var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions/[email protected]
1413837787991 addons.xpi DEBUG Ignoring file entry whose name is not a valid add-on ID: /var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions/webdriver-staging
1413837787992 addons.xpi DEBUG checkForChanges
1413837787998 addons.xpi DEBUG Directory state JSON differs: cache [] state [{"name":"app-global","addons":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"descriptor":"/Applications/Firefox.app/Contents/MacOS/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}","mtime":1411702628000,"rdfTime":1411702627000}}},{"name":"app-profile","addons":{"[email protected]":{"descriptor":"/var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions/[email protected]","mtime":1413837787000,"rdfTime":1413837787000}}}]
1413837788002 addons.xpi-utils DEBUG Opening XPI database /var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions.json
1413837788003 addons.xpi DEBUG New add-on [email protected] installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1413837788040 addons.xpi-utils DEBUG Make addon app-profile:[email protected] visible
1413837788041 DeferredSave.extensions.json DEBUG Save changes
1413837788041 DeferredSave.extensions.json DEBUG Save changes
1413837788041 addons.xpi DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1413837788043 addons.xpi-utils DEBUG Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1413837788043 DeferredSave.extensions.json DEBUG Save changes
1413837788043 DeferredSave.extensions.json DEBUG Save changes
1413837788047 addons.xpi DEBUG Updating database with changes to installed add-ons
1413837788047 addons.xpi-utils DEBUG Updating add-on states
1413837788048 addons.xpi-utils DEBUG Writing add-ons list
1413837788266 DeferredSave.extensions.json DEBUG Starting timer
1413837788293 DeferredSave.extensions.json DEBUG Starting write
1413837788297 addons.manager DEBUG shutdown
1413837788299 addons.xpi DEBUG shutdown
1413837788299 addons.xpi-utils DEBUG shutdown
1413837788330 DeferredSave.extensions.json DEBUG Write succeeded
1413837788330 addons.xpi-utils DEBUG XPI Database saved, setting schema version preference to 16
1413837788330 addons.xpi DEBUG Notifying XPI shutdown observers
1413837788332 addons.manager DEBUG Async provider shutdown done
1413837788532 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1413837788533 addons.manager DEBUG Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1413837788534 addons.xpi DEBUG startup
1413837788535 addons.xpi DEBUG Skipping unavailable install location app-system-share
1413837788535 addons.xpi INFO Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to /Applications/Firefox.app/Contents/MacOS/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
1413837788536 addons.xpi INFO Mapping [email protected] to /var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions/[email protected]
1413837788536 addons.xpi DEBUG Ignoring file entry whose name is not a valid add-on ID: /var/folders/yy/c70_0kdn7nz_p4ys8pxm_n3438x977/T/anonymous508798624517507211webdriver-profile/extensions/webdriver-staging
1413837788536 addons.xpi DEBUG checkForChanges
1413837788541 addons.xpi DEBUG No changes found
*** Blocklist::_preloadBlocklistFile: blocklist is disabled

Command duration or timeout: 46.19 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'LM-AUN-00874562', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.7.0_45'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
10.20.2014 15:43:53.511,[9] com.paypal.selion INFO Please review the test report for the screenshot at the time of failure.
2014-10-20 15:43:53.571:INFO:osjsh.ContextHandler:stopped o.s.j.s.ServletContextHandler{/,null}
10.20.2014 15:43:53.623,[1] com.paypal.selion INFO Local hub has been stopped
10.20.2014 15:43:53.887,[1] com.paypal.selion INFO Local node has been stopped
10.20.2014 15:43:53.948,[1] com.paypal.selion INFO generating report /Users/bbheemanadham/testProject/Sample/target/surefire-reports/html/report.html
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 48.581 sec <<< FAILURE!

Results :

Failed tests: DemoTest1(com.mycompany.test.Demo): An error occured while setting up the test environment. (..)

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

Unclear documentation w.r.t naming locators/selectors in PageYAML

The page http://paypal.github.io/SeLion/html/documentation.html#pageyaml incorrectly conveys that each SeLion Element type strictly maps to a html element. We need to fix this.

Problematic text

The name to be given to identifying the locator/selector. This name would end up serving as the data member in the generated class and maps to the html element specified. The rules for naming locators/selectors are as follows:
<prefix>Button Is a Button html element.
<prefix>CheckBox Is a Check Box html element.
<prefix>DatePicker Is a Date Picker html element.
<prefix>Form Is a Form html element.
<prefix>Image Is a Image html element.
<prefix>Label Is a Label html element.
<prefix>Link Is a Link html element.
<prefix>RadioButton Is a Radio Button html element.
<prefix>List Is a Select List html element.
<prefix>Table Is a Table html element.
<prefix>TextField Is a Text Field html element.
<prefix>Container Is a Container html element.

More accurately, the following is true;

If you look at the code for all of the Element types unique to SeLion, none of them are strictly tied to a html element.

Rather, they each expose a set of properties or methods which one would expect to map to the html element that gives the class it's name. So, in the case of Label, the class only adds the method isTextPresent(). This means you can expect that if you pass any locator to an html element with inner text, you can map it to Label in PageYAML and access the isTextPresent() method in java code. You can use Label for a div, span, p nodes, for example, if you are looking to verify the text contained by them.

Unclear error messages displayed when unable to parse a PageYAML document

If you have a syntax error in your PageYAML document, you could see the following error displayed by the code generator, which does not indicate a corrective action to take.

[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.paypal.selion:SeLion-Code-Generator:1.0.0-SNAPS
HOT:generate (default) on project Sample:
 SeLion code generator failed when generating code for publisher.yaml
Root Cause :
java.lang.IllegalArgumentException: Missing or incorrect platform in Data file:C:\projects\selion-qa\Sample\src\main\resources\GUI
Data\publisher.yaml

To reproduce this, use the following PageYAML file which is missing the locale definition for the locator;

baseClass: "com.paypal.selion.testcomponents.BasicPageImpl"
pageTitle:
  US: "API Page"
elements:
  loginTextField:
    locators:
       "@id='txtUsername'"
defaultLocale: "US"
pageValidators: []

The error message displayed is misleading. It suggests that the user needs to specify 'platform'. However, by design 'platform' should default to 'web' and is only required if the PageYAML is not for 'web'. Instead it should simply say, "the document could not be parsed" or something similar.

Furthermore, if you run mvn --X generate-sources you get the following, which is also not very helpful. It only slightly suggests a parsing error -- in a cryptic way. :)

[INFO] Generating java file for YAML file [publisher.yaml] in domain []
[DEBUG] Unable to process src\main\resources\GUIData\publisher.yaml as PageYaml V2.
         null; Can't construct a java object for tag:yaml.org,2002:com.paypal.selion.plugins.Page; exception=Cannot crea
te property=elements for JavaBean=pageTitle: API Page
baseClass: com.paypal.selion.testcomponents.BasicPageImpl
elements: 0
pageValidators: 0
defaultLocale: US
; Cannot create property=locators for JavaBean=com.paypal.selion.plugins.GUIElement@502f1f4c; No single argument constru
ctor found for interface java.util.Map;  in 'reader', line 1, column 1:
    baseClass: "com.paypal.selion.te ...
    ^
[DEBUG] ++ Processing src\main\resources\GUIData\publisher.yaml as PageYaml V1
[DEBUG] Reading keys from data file [src\main\resources\GUIData\publisher.yaml]
[DEBUG] Specified platform in data file [src\main\resources\GUIData\publisher.yaml] : [null]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

Add configuration setting to set selion log file limits.

With the recent changes to SimpleLogger (which is used by SeLionLogger) 003b480 we have an opportunity to add a new configuration option that will control the log file limits. For example, we can now limit the number of log files and/or the size before rolling to a new file. We should define a default behavior, add it to our SeLionLoggerSettings, and give the user the ability to override the default behavior.

Remove `<repositories>` section of parent POM for publishing to Central

Code-Generator produces code which will not compile when PageYaml document resides in src/main/resources/GUIData

  • If you put a PageYaml document in the top-level folder under src/main/resources/GUIData, the code-generator will produce a corresponding class with and invalid package declaration -- it will end with a .
  • Also, the site documentation http://paypal.github.io/SeLion/html/documentation.html#what-is-code-generator, bullet 2 under "Put the SeLion Code Generator in Action" is mis-leading. The file, once created, should reside in ANY directory under src/main/resources/GUIData ... It does not have to be placed in the top-level of this location.

@MobileTest iOS not honoring locale and language settings

Please see the example below if I run this test case the simulator is still being launched with language=en and locale=en_US.

package com.symbio.test;

import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import org.testng.annotations.Test;

import com.paypal.selion.annotations.MobileTest;
import com.paypal.selion.platform.grid.Grid;
import com.paypal.selion.reports.runtime.MobileReporter;

public class IOS_Multi_Locale {

    @MobileTest(appName = "InternationalMountains", language="fr", locale="fr_FR")
    @Test
    public void testMethod() throws InterruptedException {
        MobileReporter.log("My Screenshot 1", true);
        List cells = Grid.iOSDriver().findElements(By.className("UIATableCell"));
        Assert.assertEquals(9, cells.size());

        // get the 1st mountain
        WebElement first = (WebElement) cells.get(0);
        first.click();
        Thread.sleep(10 * 1000);

        // take a screenshot using the normal selenium api.
        MobileReporter.log("My Screenshot 2", true);

        // access the content
        By selector = By.xpath("//UIAStaticText[contains(@name,'climbed')]");
        WebElement text = Grid.iOSDriver().findElement(selector);
        System.out.println(text.getAttribute("name"));
    }

}

fault handling on the browser parameter value

In case users didn't add asterisk in the browser parameter of the suiteXmlFile:

  <parameter name="browser" value="chrome"/>

NPE will throw without indication:

Running TestSuite
02.25.2015 23:22:03.034,[1] com.paypal.selion INFO JDK Information: Java HotSpot(TM) 64-Bit Server VM from Oracle Corporation ver. 1.7.0_40
02.25.2015 23:22:03.037,[1] com.paypal.selion INFO Runtime Report : /.../surefire-reports/RuntimeReporter/index.html
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
02.25.2015 23:22:03.811,[14] com.paypal.selion INFO Local Hub spawned
02.25.2015 23:22:03.995,[14] com.paypal.selion INFO Local node spawned
02.25.2015 23:22:04.110,[14] com.paypal.selion INFO Attached node to local hub http://localhost:4444/grid/register
02.25.2015 23:22:04.120,[14] com.paypal.selion WARNING An exception occured after the test method invocation. Gobbling it as the test case itself did not fail
java.lang.NullPointerException
    at com.paypal.selion.platform.grid.Grid.wrappedDriver(Grid.java:97)
    at com.paypal.selion.reports.runtime.WebReporter.log(WebReporter.java:63)
    at com.paypal.selion.platform.grid.WebTestSession.warnUserOfTestFailures(WebTestSession.java:437)
    at com.paypal.selion.platform.grid.WebTestSession.closeCurrentSession(WebTestSession.java:410)
    at com.paypal.selion.platform.grid.SeleniumGridListener.afterInvocation(SeleniumGridListener.java:262)
    at org.testng.internal.invokers.InvokedMethodListenerInvoker$InvokeAfterInvocationWithoutContextStrategy.callMethod(InvokedMethodListenerInvoker.java:100)
    at org.testng.internal.invokers.InvokedMethodListenerInvoker.invokeListener(InvokedMethodListenerInvoker.java:62)
    at org.testng.internal.Invoker.runInvokedMethodListeners(Invoker.java:619)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:777)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
02.25.2015 23:22:04.206,[1] com.paypal.selion INFO Local hub has been stopped
02.25.2015 23:22:04.576,[1] com.paypal.selion INFO Local node has been stopped
02.25.2015 23:22:04.618,[1] com.paypal.selion INFO generating report .../surefire-reports/html/report.html
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.045 sec <<< FAILURE!

We should handle the exception to indicate the user mistakes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.