I´m currently integrating my cucumber jvm/selenium project with zalenium.
It´s easy and everything works like charm, but only one little exception.
When driver is instantiated for zalenium, I send desired capabilities like:
desiredCapabilities.setCapability("build","My release name");
desiredCapabilities.setCapability("name","My test name");
And zalenim dashboard reflects this data ok.
But....how cand I send my dynamic cucumber scenario name to this capabilities? It´s possible???
I dont know how can I do this, because at the time of desiredcapabilities definition, cucumber scenarios are not parsed yet and scenario.getName() is always null, and I cant find a way to overwrite de default zalenium scenario name with this value.....
For example, to set final tests status in dashboard, zalenium uses sendCookie to change this vaue, but i cant find any similar for test name.
May appear a silly question, and I´m sure that has a silly answer... :D
Some help??
Thanks in advance!!!
You can do this by instantiating your browser in Cucumber Before hook and then passing the name to DesiredCapabilities
Related
I am looking for implementation help for logging in extent report. I want my feature names to be logged only once in the report and all its scenarios on right hand side
Issue here is that i am not sure where to implement createtest() method in the framework and how to log feature name dynamically.
With com.vimalselvam.cucumber.listener.ExtentCucumberFormatter it
dynamically captures feature file name automatically and it works
fine for me but this has limited methods like Reporter.addStepLog("String")
Hence I want to achieve this with com.cucumber.listener.ExtentCucumberFormatter:target/html/ExtentReport.html
plugin since i want to use methods like createnode() to create node under each scenarios, log info etc so that i can attach screenshot at every node
I did try using ItestListeners, hooks etc but was not able to find solution.
please advise.
Please see notes on the picture to understand my requirement Issue with Vimalsevan plugin
Issue with com.cucumber.listener.ExtentCucumberFormatter plugin with creatTest() method
I have an native mobile application that loads my react application within a child iframe (not sure exactly how it does it), but this application injects some variables into the page as windows.xxxx
So in order to test my application (yes, this sucks a lot) I need to run the app on my phone, have it open up the URL on my development machine (aka http://192.168.10.10:3300).
Then to debug anything I'm forced to alert(var1) .. as you can imagine this is a pretty painful process and I really wish the parent application would provide something better than this.
Normally a simple option would be something like console.log(var1) but I can't see the console on my mobile device and my URL is being loaded withing this native app.
So:
1. Any suggestions on a better debug process would be welcome.
2. One idea that would help is if there was a react component that would simply
print to screen anything any console.log().
3. I guess another option could be some kind of remote logger, so that console.remotelog(debugServerUrl, var1) pushes debug messages to the listener which then displays the debug.
All of this if a pain of course, but hoping someone out there has a clever idea for me.
If you're already using ReactJS, an easy quick-fix might be creating a log file in the phone. This post details a quick and relatively easy way to save a string as a text file, and it would not be hard to put everything you want saved into a string.
Furthermore, This post details an implementation of the remote logging feature you vaguely referenced.
Also, if you want to capture stdout and stderr, check out this npm package
Ultimately, hope this helps, and good luck
I'm very new to Jenkins and just hacking my way through it, please forgive me if this is a simple question. I'm using Extended Choice Parameter Plug-In to create a multi select box for a build, pretty much just a list of locations to copy files to. I have the list hardcoded in the build. This has been working great...
however I would like to have this list generated from a database table I have in MSSQL. I've poked around and I've found references to 'groovy scripts' and a variety of other plug-ins, and many of these posts are very dated. So I don't want to hunt down the wrong path and build something out of date.
What is the suggested plugin to use to created a multi select in a Jenkins build that can be populated from a MSSQL database? Do I need a 'groovy' plug-in as well?
If it's helpful, I'm skilled with python and perl, if 'groovy' isn't optimal. Thank you for your patience and time!
I find a solution to fix the problem. But it's a little bit dirty.
directly import your Driver in your class :
import net.sourceforge.jtds.jdbc.Driver;
DriverManager doesn't manage to find the good driver when you use it in Jenkins so you can simply instantiate your driver :
this.p = new Properties();
p.put("user", "user");
p.put("password", "password");
Driver d = new Driver();
con = d.connect("jdbc:jtds:sqlserver://"+p.getProperty("db.host")+":1433;databaseName="+p.getProperty("db.name")+";instance="+p.getProperty("db.instance"),p);
then, you will probably have a new error with SSO. So you can follow this guide : I/O Error: SSO Failed: Native SSPI library not loaded
You simply have to add a dll in your jdk/bin folder to make your driver work.
That's the only way I found and I think it's more a hack than a real solution ! Happy coding ;)
I'm a protractor learner. So, I'm trying different methods in my tests while I'm testing my application. So, I was using browser.setLocation Before Each test for cases like page redirected during the test run, instead of just using browser.driver.get
As I understand I think using of browser.setLocation resolved lots of random failures I faced while running the test. I didn't want to use a browser.sleep().
I read this Protractor documentation for more clarification and it doesn't help.
Can someone tell me the usage of this method. Any kind of information will be appreciated.
Thanks in advance. :)
browser.setLocation() uses Angular's $location. browser.driver.get is like typing in a new URL into the search bar. browser.get, which is what most people use, is a wrapped version of browser.driver.get which waits for everything to be synced.
I am developing a basic yet highly customized CRM for a small training centre which has the ability to store student records and also send emails to them. I'm using SwiftMailer following this excellent tutorial in CakePHP to accomplish the sending part.
Of course, students are sometimes going to reply to emails and I'd like to retrieve them within my CRM and store them along with the student record.
However, I cannot find a single reference to doing this. I've tried the following Google searches: "receiving email cakephp" , "retrieving email cakephp" and even "email client cakephp" but all of these queries give results relating to sending mail rather than receiving it -- very frustrating!
Finally, I broadened my search to non-cake solutions and found someone recommending a library called ezComponents. It doesn't seem to have had any active development for about a year, but it includes an email receiving class which is exactly what I want. Unfortunately, I have no idea how to add this to CakePHP and the only post I've been able to find on the entire web on the matter doesn't exactly go into much detail. It's certainly not a step-by-step tutorial on using ezComponents on CakePHP like the SwiftMailer tutorial I mentioned above.
I also found a class on Google Code called php-imap which looks like it would do the job but, again, I haven't the slightest clue how to get it working happily in Cake like SwiftMailer is.
I realize that I may have to learn how to package classes for use in Cake by myself but I'm asking this question first on the off-chance that there is already a Cake-friendly solution to this problem that I just haven't realized :-)
Joseph
Thanks to everyone for your answers, but I've been doing some more searching and it looks like the solution is actually incredibly simple.
Basically, with the help of a plugin, I can set up the mail server in databases.php as a datasource and then write a Model and Controller to interact with it.
Here's the example I found: https://github.com/kvz/cakephp-emails-plugin
Edit: the repo has been deprecated and is now available at https://github.com/kvz/deprecated/tree/cakephp-emails-plugin
You will want to pipe your email to PHP and use stdin:// to read the contents of the email and add the e-mail to your database.
I've done this with cake and the simplest way is to make a Cake console application to handle the parsing. Also using cpanel's account level filtering to generate the pipe is really simple.
http://forums.cpanel.net/f5/piping-mail-php-scripts-howto-checklist-50985.html
http://www.evolt.org/incoming_mail_and_php
Sounds like you want to include SwiftMailer as a Cake plugin, amirite?
http://book.cakephp.org/view/1111/Plugins
-- if you want to package it yourself. Otherwise, a cursory search of the Bakery yielded this result:
http://bakery.cakephp.org/articles/sky_l3ppard/2009/11/07/updated-swiftmailer-4-xx-component-with-attachments-and-plugins
Hopefully it will at least get you pointed in the right direction. HTH. :)