How to access Selenium driver when coding with CodeceptJs - selenium

In order to debug an issue, I'd like to try some of the raw Selenium methods such as Actions or Javascript executor to access my elements, but as I'm behind the CodeceptJs framework, I'm not sure how I'd access the driver that these methods require, please? I'm writing my tests using BDD, Cucumber and Javascript.
Thank you.

Related

Customized Reports for Protractor test

I am newbie from Selenium to Protractor. I am extensively using well customized reports such as Extent and ATU reports.
But in protractor i don't find anything apart from basic XML and jasmine2HTML. Is there anyone aware of any third party such as Extent/ATU in selenium for protractor?
If you are using Jasmine as your Protractor driver then you can create a custom reporter that does whatever you want.
https://jasmine.github.io/2.1/custom_reporter.html

Fitnesse: integration with Selenium WebDriver

I am working on a Selenium WebDriver project, written using the page object pattern.
I wanted to know whether is there any way in which I can integrate FitNesse and Selenium WebDriver project?
I know FitNesse can be used with Selenium IDE, however, I have no idea whether is it possible to use Fitnesse with WebDriver.
You sure can, it's just Java after all. One example of such a project is (my own set of FitNesse fixtures): https://github.com/fhoeben/hsac-fitnesse-fixtures.
You could use my fixture (BrowserTest) to execute the test. Or only use the web driver setup fixture (selenium driver setup), which also also the setup to be overridden in a CI environment, and do your own thing with web driver in a custom fixture.

Is it possible to use Selenium IDE html test and capture screenshots on failure

I have created a few HTML test suites with Selenium IDE. They are automatically tested and by Jenkins daily. Now, I'm wondering if it is possible to create a screenshot whenever a test fails.
Is it possbile to catch the exeption when the IDE test fails and capture the screen? Or is it only possible with TestNG? If it's only possible with TestNG, how does selenium HTML tests work combined with TestNG?
Kind regards,
Selenium IDE doesn't directly support saving screen shots like this. Check out this other (duplicate) question: Screenshots using Selenium IDE Firefox plugin
selenium ide does not have built in screenshot capabilities, but you can inject raw javascript: "javascript{alert();}" will display an alert. If you can find a way to do it in javascript, you could add the js to selenium ide.

Selenium IDE or Builder, can they connect with Selenium Server 2?

Is there any possible way to execute the output of either Selenium IDE browser plugin or Selenium Builder plugin with the selenium-server-standalone.jar?
When I try to execute the Selenium IDE selenese output with the -htmlSuite flag of the selenium-server JAR, the server complains that sendKeys is not a valid command. sendKeys is a selenium V1 command, but the Selenium IDE outputs V2. You'd think the server could execute V2 syntax, but it can't.
When I save V1 syntax from Selenium Builder, and try to execute that with the -htmlSuite flag I get an error that "click" does not implement the event interface. (I'm guessing some other v1/v2 incompatibility)
There doesn't seem to be a way to execute the JSON output of Builder against the server either (there's a Jenkins plugin that claims to do this, but it doesn't seem to have enough logging or debug information to tell if it did anything at all).
Is there anyway to run the output of any GUI tool against Selenium Server 2?
UPDATE:
According to this bug, the selenese runner part of selenium server is abandoned. https://code.google.com/p/selenium/issues/detail?id=4349 But why would someone bother compiling, packaging and shipping abandoned code that doesn't work? I find it really hard to believe that something as popular as Selenium doesn't work with its own IDE browser plugin.
Yes, you can. First, do your research in the Selenium documentation and start a Selenium Grid on your computer. Then, you can use Maven to run Selenium Builder scripts (using a method like what I have done here: http://djangofan.github.io/maven-selenium-builder/ )
Of course, for the Builder scripts to connect to the Grid hub you need to change the calls to:
new FirefoxDriver();
to this instead:
new RemoteWebDriver( "http://hubIP:4444/wd/hub", capabilities );
, or something similar.
Thats it.
The correct answer is, "no, Selenium Server v2 does not support Selenium IDE output nor Selenium Builder output".
If you want to use the output of Selenium IDE browser plugin you need the incredible Selenese Runner project.
https://github.com/vmi/selenese-runner-java
Why this requires a 3rd party tool and isn't part of the Selenium family of products is beyond me.

Is TestNG enough as a web test framework?

I just moved into web testing using Selenium and have been learning Selenium WebDriver + Java.
My question is, why do I need to build a test framework when TestNG is there?
What is there that TestNG cannot do as a framework?
Nothing :-)
More seriously, TestNG is very popular with Selenium users for a variety of reasons, among which support for:
Dependencies (very convenient to test pages that follow each other).
Parameterization with #DataProvider (useful to test various combinations of browsers and user agents).
Parallel tests (lets you test on multiple browsers simultaneously).
Check out the Selenium forums for more information and feel free to email the testng-users list if you have questions.
Yes, I think TestNG is enough as a web test framework. If you are familiar of using JUnit, It is easier to switch into TestNG
Building a custom framework may be necessary at times.
And you can use TestNG for that. :)