wasiqb / coteafs-selenium Goto Github PK
View Code? Open in Web Editor NEW:computer: Selenium WebDriver wrapper framework in Java for clean and maintainable tests.
Home Page: https://wasiqb.github.io/projects/selenium/
License: Apache License 2.0
:computer: Selenium WebDriver wrapper framework in Java for clean and maintainable tests.
Home Page: https://wasiqb.github.io/projects/selenium/
License: Apache License 2.0
Describe the bug
When using find
or finds
method on a parent IElementAction
, then it is mandatory to cast it as IMouseAction
if that elements method is having return type as IMouseAction
.
To Reproduce
public IMouseActions navbar (final String name) {
return (IMouseActions) navbar ().finds (By.cssSelector ("li > a"))
.stream ()
.filter (m -> m.text ()
.trim ()
.equals (name))
.findFirst ()
.get ();
}
Expected behaviour
Casting should be done automatically.
Currently, when screen state is set as NORMAL, NPE is encountered.
java.lang.NullPointerException
at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.setSize(RemoteWebDriver.java:798)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWindow.setSize(EventFiringWebDriver.java:748)
at com.github.wasiqb.coteafs.selenium.core.Browser.lambda$setScreenSize$2(Browser.java:140)
at com.github.wasiqb.coteafs.selenium.core.Browser.manageWindow(Browser.java:126)
at com.github.wasiqb.coteafs.selenium.core.Browser.setScreenSize(Browser.java:140)
It is required to log user interaction in a log file. Following files should be created:
Logs should not be:
Perform maximum logging to capture each events. TestNG listeners should be used for logging run-time test events.
As a test engineer, I want to video record my Web App tests to see the exact point of failure along with what action steps were executed when the app failed.
Is your feature request related to a problem? Please describe.
Since alpha release is not stable and is subject to constant changes, it is needed to use stable Selenium WebDriver.
Describe the solution you'd like
Use Selenium WebDriver 3.141.59 instead of 4.0.0-alpha2
Is your feature request related to a problem? Please describe.
Currently wait strategy is only implemented in onElement
method.
Describe the solution you'd like
Now same is required to be added on find
and finds
methods in IElementActions
interface.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
##@WasiqB
Instend of putting all Webdriver like chrome driver ,gecko driver into drivers folders with respect to OS.
we can get the OS First then based on that we can use webdriverManaged dependency in pom.xml
io.github.bonigarcia
webdrivermanager
3.4.0
test
and use it via
WebDriverManager.chromedriver().setup();
WebDriverManager.firefoxdriver().setup();
Kotlin allow you to do much more with less. Kotlin as language is interoperable, concise and secure. Being a programming language that runs on the virtual machine of Java (JVM); allows an open interaction with the Java code and therefore with the frameworks and libraries available for Java in an almost transparent way.
Kotlin takes the best of Java and Scala, the response times are similar as working with Java natively, which is a considerable advantage over Scala
Is your feature request related to a problem? Please describe.
Currently there is no javadoc description on any of the public classes, enums, interfaces, methods, constants.
Describe the solution you'd like
Need to add detailed description on all the public accessible objects and methods.
Is your feature request related to a problem? Please describe.
Currently all elements action is logged but it is very difficult to identify what element is under action.
[17:01:26.645] [INFO ] - Writing text [mngr26593]... (DriverListner:116)
[17:01:27.823] [INFO ] - Writing text [abc@123]... (DriverListner:116)
[17:01:29.031] [INFO ] - Clicking on Element... (DriverListner:122)
Describe the solution you'd like
To identify what element is under operation, it is needed to have alias feature available.
It is required to integrate with ReportPortal.
Is your feature request related to a problem? Please describe.
In IServiceAction
interface, we can start
and stop
the service but cannot check if the service is running or not.
Describe the solution you'd like
A new method isRunning
needs to be added to handle that.
Currently, drivers are being picked from src/main/resources/drivers
directory.
But since all drivers are packaged in the JAR itself, it is required to pick the drivers from the JAR's directly.
CI / CD pipeline should be created to execute unit tests for the framework and to calculate code health with the help of SonarQube and CircleCI.
When PageFactory.init is removed from a particular page, Framework automatically switches to the first Page where init is called.
Steps:
Acceptance Criteria:
Proper error/exception should be thrown in this case and framework should not switch to base class where init method is called.
Framework should be more generic to allow extensibility in coteafs-appium as well.
As a User, I should be able to run my tests on safari browser using this framework.
Framework should support executing tests in IE and Edge Browsers.
The issues can be found on sonarcloud.
Is your feature request related to a problem? Please describe.
Currently there is no enforcement on coding style which will cause style mismatch among the contributors. Looking at the growth of the project, it'll be ideal to have code style cop configured which will fail the build in case of style mismatch.
Describe the solution you'd like
In phase 1, the coding style will be configured in this project, later on it will be moved to parent project.
As an automation engineer, I should be able to switch between iframes using coteafs-selenium framework.
Currently, IFrame support is not available in this framework.
README needs to be updated so new visitors are able to understand the usage of the framework.
Unit test coverage should be more than 80% when calculated in SonarQube.
A builder class is required to build browser element in a hierarchical structure and store following attributes:
Describe the bug
saveScreenshot
to attachScreenshot
.saveScreenshot
with no param.saveScreenshot
with path param.Following files needs to be added to the repository for encouraging contribution by the community:
Following error message is displayed when user tries to assert on element object:
The method verifyDisplayed() from the type IVerifyElement refers to the missing type BooleanSubject
Steps:
Currently, user is not allowed to use assertion and above error message is displayed.
Acceptance Criteria:
User should be allowed to use assertion successfully without any error.
Currently tests are failing in Circle CI, this needs to be solved.
Need to check with Selenium WebDriver Java client 4.0 alpha 2.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Following error logs are generated when user tries to run tests in Edge Browser:
io.github.bonigarcia.wdm.WebDriverManagerException: io.github.bonigarcia.wdm.WebDriverManagerException: MicrosoftWebDriver.exe should be installed in an elevated command prompt executing: dism /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:715)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:540)
at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:260)
at com.github.wasiqb.coteafs.selenium.core.Browser.setupEdgeDriver(Browser.java:169)
at com.github.wasiqb.coteafs.selenium.core.Browser.setupDriver(Browser.java:153)
at com.github.wasiqb.coteafs.selenium.core.Browser.start(Browser.java:225)
at com.github.wasiqb.coteafs.selenium.core.BrowserTest.setupTest(BrowserTest.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
at org.testng.TestRunner.beforeRun(TestRunner.java:529)
at org.testng.TestRunner.run(TestRunner.java:497)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: io.github.bonigarcia.wdm.WebDriverManagerException: MicrosoftWebDriver.exe should be installed in an elevated command prompt executing: dism /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0
at io.github.bonigarcia.wdm.WebDriverManager.checkInsiderVersion(WebDriverManager.java:599)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:499)
... 29 more
As an Automation engineer, I would need to continue writing my steps without initialising other pages in the flow.
Steps to reproduce:
TestNG.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" thread-count = "1" parallel="tests">
<test name="ChromeTest">
<parameter name="browser" value="Chrome">
<classes>
<class name="com.wizonsoft.tests.RegisterUserTests" />
<class name="com.wizonsoft.tests.SignoutTests" />
</classes>
</parameter>
</test>
<test name="FirefoxTest">
<parameter name="browser" value="FIREFOX">
<classes>
<class name="com.wizonsoft.tests.RegisterUserTests" />
<class name="com.wizonsoft.tests.SignoutTests" />
</classes>
</parameter>
</test>
<test name="EdgeTest">
<parameter name="browser" value="EDGE">
<classes>
<class name="com.wizonsoft.tests.RegisterUserTests" />
<class name="com.wizonsoft.tests.SignoutTests" />
</classes>
</parameter>
</test>
</suite> <!-- Suite -->
Here, All the tests run in Chrome browser only, even when different browsers are specified.
Acceptance Criteria:
Tests should run correctly as per the browser specified in the testng.xml file.
IScriptAction and IScreenAction are functional interfaces and should be declared as Functional interfaces as with java8-api
Describe the bug
Multiple remote configuration should be handled in the single config file. Currently, user has to create separate config files for running tests on different remote configuration settings.
To Reproduce
In selenium-config file if user wants to run tests in selenium grid for chrome as well as firefox browsers. In this case, user is allowed enter only either chrome or firefox settings in the selenium-config file for the other a new config file has to be created.
While trying to select element from a dropdown box, framework is unable to locate element using ISelectBoxActions interface as it is unable to find element as it is currently not visible.
When the same is run through raw selenium, it gets located correctly.
Is your feature request related to a problem? Please describe.
Currently there is no generic param declared on some interfaces. This is a problem when extending the same in coteafs-appium
project.
Describe the solution you'd like
Following are the interfaces which needs a default implementation class with generic params if needed.
IDriver
IDriverAction
IWebDriver
IWebDriverAction
IElementAction
IMouseAction
IKeyboardAction
ITextboxAction
ISelectboxAction
User should be able to configure the path for saving the screenshot.
Currently, path to save screenshot is not handled in the framework
Selenium tests needs to be updated so that it can be run in all supported browsers.
Currently, the website "Guru99 bank Project" used for running tests has support for Chrome browser only, hence the tests are not successful in Firefox and IE browsers.
Selenium tests will now be conducted on "Saucedemo.com" which supports Chrome,IE as well as Firefox browsers.
A base class named Browser should be created which has following features:
This class is responsible for the following:
Modularise interfaces further for better maintenance.
Following config is required to be supported:
Is your feature request related to a problem? Please describe.
Currently there is no control for the user on WebDriverManager on how and where it should download the driver exe.
Describe the solution you'd like
It is required to allow user the control on WebDriverManager, like:
More settings can be handled later if requested.
Selenium Tests should run successfully on Cross Platform and different browsers through Browser Stack site.
An abstract class is required where we can define individual page flows which will help in reducing duplicate codes. It will have following properties:
Add reference to dependency for adding dependency in a gradle project
Following error is encountered when using pause
method of Actions
class:
[12:29:58.234] [ERROR] - Error occurred: actions
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'Wasiqs-MacBook-Pro.local', ip: 'fe80:0:0:0:404:9092:6fb0:addf%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.4', java.version: '1.8.0_202'
Driver info: driver.version: EventFiringWebDriver (DriverListner:335)
[12:29:58.234] [ERROR] - Error occurred: org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:218) (DriverListner:337)
[12:29:58.235] [ERROR] - Error occurred: org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:117) (DriverListner:337)
[12:29:58.235] [ERROR] - Error occurred: org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:152) (DriverListner:337)
[12:29:58.235] [ERROR] - Error occurred: org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) (DriverListner:337)
[12:29:58.236] [ERROR] - Error occurred: org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548) (DriverListner:337)
[12:29:58.236] [ERROR] - Error occurred: org.openqa.selenium.remote.RemoteWebDriver.perform(RemoteWebDriver.java:614) (DriverListner:337)
[12:29:58.237] [ERROR] - Error occurred: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) (DriverListner:337)
[12:29:58.237] [ERROR] - Error occurred: sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) (DriverListner:337)
[12:29:58.237] [ERROR] - Error occurred: sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) (DriverListner:337)
[12:29:58.238] [ERROR] - Error occurred: java.lang.reflect.Method.invoke(Method.java:498) (DriverListner:337)
[12:29:58.238] [ERROR] - Error occurred: org.openqa.selenium.support.events.EventFiringWebDriver.lambda$new$1(EventFiringWebDriver.java:105) (DriverListner:337)
[12:29:58.239] [ERROR] - Error occurred: com.sun.proxy.$Proxy27.perform(Unknown Source) (DriverListner:337)
[12:29:58.239] [ERROR] - Error occurred: org.openqa.selenium.support.events.EventFiringWebDriver.perform(EventFiringWebDriver.java:360) (DriverListner:337)
[12:29:58.239] [ERROR] - Error occurred: org.openqa.selenium.interactions.Actions$BuiltAction.perform(Actions.java:640) (DriverListner:337)
[12:29:58.239] [ERROR] - Error occurred: org.openqa.selenium.interactions.Actions.perform(Actions.java:596) (DriverListner:337)
[12:29:58.240] [ERROR] - Error occurred: com.github.wasiqb.coteafs.selenium.core.ElementAction.pause(ElementAction.java:365) (DriverListner:337)
Instead use Thread.sleep
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.