Robot Framework: set logging level for a certain library - robotframework

I'm importing custom library in my test based on some other python modules which are using python logging. In certain situations python logging inside python packages emits ERROR message which I would like to disable. The problem is I've tried different ways but all of them are not working:
Set log level inside custom library for imported python module
imported_logger = logging.getLogger('<name of imported python module>')
imported_logger.setLevel(logging.INFO)
Set log level inside custom library for both current file and imported python module
imported_logger = logging.getLogger('<name of imported python module>')
imported_logger.setLevel(logging.INFO)
current_logger = logging.getLogger(__name__)
current_logger.setLevel(logging.INFO)
Set log level for robot framework
robot --loglevel INFO test.robot
All together these actions are not working. I still receiving ERROR messages from logging.
Could you please help me to solve this issue?

Related

How to import a Resource file within Test cases in Robot Framework?

I have 2 Testcases within a Robot suite. This suite is like the Initialization Suite which has a dependency on an underlying framework(UF).
UF has different folder structure for the main Initialization Suite, Functional Suites and few other tools and calls them with separate robot commands. So I cannot store variables with Set Global Variables during initialization but have to create resource files which I will import in Functional Suites.
TC1: Parses a json file and creates a variables.txt file.
TC2: Uses few variables stored in variables.txt and logs into server the gets the node details and stores in hostname.txt
Is there a way to import/source the variables.txt within TC2 ?
Looking for this implementation, as there are Common User Keywords(CUKW) which will also need this variables.txt. As this is dynamically generated I cannot define it as Resource in Settings section in CUKW.
New to Robot framework, Apologies for any misunderstanding. Any better implementation suggestions are most welcome.
Thanks in Advance!
You can use the import resource keyword.
Imports a resource file with the given path.
Resources imported with this keyword are set into the test suite scope similarly when importing them in the Setting table using the Resource setting.

fun-hooks: referenced 'registerAdserver' but it was never created

I am using adinplay and their advertisement library in my site.
It is creating noise in my console. Can I fix this problem? If not what can I do about this log?
This is caused by prebid.js an open-source header bidding library. Prebid is built with multiple optional modules using gulp. This warning is thrown because one of the modules in your build of prebid.js includes a module referencing the hook, but the module that defines the hook is not. Nothing to worry

Ionic using PounchDB fail

I`m testing PounchDB for my new app and, i receive this error when try execute this code:
PouchDB.plugin(require('pouchdb-adapter-cordova'));
_db = new PouchDB('mydb.db', {adapter: 'cordova-sqlite'});
Erro received:
ReferenceError: Can't find variable: require
I follow instructions from: https://github.com/nolanlawson/pouchdb-adapter-cordova-sqlite
Using ionic 1.
You're using require without an associated package manager or module bundler. require is not native to JavaScript -- you have to include a library or package your app in order for this to work.
I suggest JSPM (http://jspm.io), since it works with SystemJS and supports the newest ES2015 module syntax. However, it also understands require.
Alternatively, you can use Browserify(http://browserify.org) to bundle your code (essentially Browserify packs everything into one file, which is great for production!). Webpack(https://webpack.github.io) is also a great option. Both of these will add a build step to your development workflow, so be aware of that (but you should have one anyway).

sbt-native-packager bashScriptExtraDefines profiles

I want to create some kind of "branding" for scala application using sbt-native-packager.
The idea is to configure two profiles in sbt (aprofile and bprofile) and when calling specific
target it defines correct configuration file to be used when starting application.
Two configuration files
conf/a.config
conf/b.config
I want to package application using following keys
sbt aprofile:stage
sbt bprofile:stage
Sbt-native-profile defines
bashScriptExtraDefines += """addJava "-Dconfig.file=${app_home}/../conf/app.config""""
Now the question is how to create those two profiles in sbt to define bashScriptExtraDefines property accordingly. I am trying to use https://stackoverflow.com/a/20573422/289043 somehow, however I don't know how to correctly overwrite bashScriptExtraDefines.

SquashTA - Integrating existing tests

We are looking forward to using squashTA to manage our tests. The problem we are facing is that we already have a big automated tests collection and aren't able to make them run via squash TM using squash TA.
Our tests are using junit+selenium WebDriver+SpringFramework.
Currently, we launch our automated tests via maven (in commandLine), and we have a jenkins server running them regularly.
We tried to reuse our tests in a squash TA project, putting them in src/squashta/resources/selenium/java
But code in this folder doesn't even support java packages. It's like the java in the example isn't real java but a fake java parse by squashTA.
Is there any mean of using such already existing tests with squash(TA/TM) ?
Or, any alternatives you know that could do the job ? (we are currently using testlink and must change).
If your selenium test is in :
src/squashTA/resources/selenium-test/src/main/java/org/squashtest/ta/selenium/PetStoreTest.java
With a such structure, the test automation script to run the selenium test (which is in the package org.squashtest.ta.selenium) is :
TEST :
LOAD selenium-test/src/test AS seleniumTestSource
CONVERT seleniumTestSource TO script.java(compile) AS seleniumTestCompiled
CONVERT seleniumTestCompiled TO script.java.selenium2(script) USING $(org.squashtest.ta.selenium.PetStoreTest) AS seleniumTest
EXECUTE execute WITH seleniumTest AS seleniumResult
ASSERT seleniumResult IS success
If your selenium test has some dependencies to other libraries (like to spring in your case), you have to add those depencencies as dependency of the squash-ta-maven-plugin in the pom.xml of your Squash TA project

Resources