How to set the config file location for webdriver IO - webdriver-io

I have set up a Webdriver IO test framework and manually created my config file. This is located in a config folder, however when I run wdio I get an error message stating that there is missing configuration.
How do I tell wdio the config file (wdio.conf.js) location or do I have to have it placed at root?

You can pass in the location of the config file as the first parameter to your wdio command. For example:
npx wdio ./config/wdio.conf.js

Related

About Missing Remote File

When I run the pipeline, the Gitlab server alerts me that the remote YML file is missing, I used the Custom project CI config Path,(Setting => CI/CDL =>General pipelines=>Custom CI Config Path), below is my setup and error screen shot
Custom CI Config Path
Error Screnn Shot:Missing File
References to external YML are only supported in versions after Gitlab 12.6 after checking the official documentation

Read configuration values in robot framework

I have a robot framework test automation product that runs in a docker container. All the configurations for the project are written in a .env file and all works perfectly in the docker environment.
Wat I want is to run this project out side the docker environment(in my laptop using VS code or any other supported IDE). But I don't know how to set the configuration environment when I run the project out side the docker environment.
Can someone please tell me the best way of doing this.
I found the soultion.
1.You create .env file as below and put all of your environment variables as below. This is the environment file that you are going to push in to the docker container.
HOST_ADDRESS="https://192.168.0.15"
DEFAULT_PORT="8056"
2.Create .yaml file called LocalConfig.yaml and place all your local configuration in that file as below.
LOCAL_HOST_ADDRESS: "https://192.168.0.10"
LOCAL_DEFAULT_PORT: "8055"
3.Create .resource file called Config.resource and read all the environment variables from the OS environment using % character and if the environment variable is not found in the OS, you can set the default value which is defined in the LocalConfig.yml file as below.
*** Settings ***
Variables LocalConfig.yaml
*** Variables ***
${CONFIG_HOST_ADDRESS} %{HOST_ADDRESS=${LOCAL_HOST_ADDRESS}}
${CONFIG_PORT} %{DEFAULT_PORT=${LOCAL_DEFAUL_PORT}}
4.Then you can reference this Config.resource file in any of your .robot files and retrieve the configuration values.
Example:
*** Settings ***
Resource ../Config.resource
*** Variables ***
*** Test Cases ***
Retrieve env variable Test
Log To Console ${CONFIG_HOST_ADDRESS}

starting ignite cluster from command line

I am trying to start Ignite cluster from the command line on windows:
this is what I did:
Download Ignite binary version and kept it in C driver.
Set Environment Variable IGNITE_HOME to that folder location.
in command line I open the directory:
C:\apache-ignite-fabric-2.2.0-bin\bin
the from that directory :
C:\apache-ignite-fabric-2.2.0-bin\bin>sh ignite.sh examples/config/example-ignite.xml
I am getting the following error:
Failed to create Ignite component (consider adding ignite-spring module to classpath) [component=SPRING, cls=org.apache.ignite.internal.processors.spring.IgniteSpringProcessorImpl]
what can be the reason for this error?
found the solution for that:
need to run it in bat file and not sh file:
C:\apache-ignite-fabric-2.2.0-bin\bin>ignite.bat examples/config/example-ignite.xml
If you're on Windows I imagine you should try ignite.bat?
ignite.sh might have problems with classpath when run on Windows, that would explain it.

Jenkins: Error in Selenium Publish Report

I have properly configured the Seleniumhq plugin into Jenkins. I've also tried to run it in my local Jenkins and it worked. The problems I encounter are as follows:
suiteFile directory reads from C drive ONLY. Example, C:\TestSelenium\testSuite.html
When I try to specify the absolute path to my test suite (workspace), I get the error
The suiteFile is not a file or an url ! Check your build configuration.
Same thing happens with resultFile.
When I add post-build action "Publish Selenium Report," I'm getting an error because the newly created resultFile is saved into C:\TestResult\result.html and not in the workspace.

Selenium.WebDriver - I get error when I try to run my test in Chrome

I get this error when I try to run my test in Chrome:
Initialization method AutomationUsingSelenium.SmuladorChrome.MyTestInitialize threw exception. OpenQA.Selenium.DriverServiceNotFoundException: OpenQA.Selenium.DriverServiceNotFoundException
What is the cause?
Finally I resolved my issue as follows:
1) I copied chromedriver.exe in Chrome directory link, but you can put it in any directory. I decided to put it here.
2) I Initialized a new instance of the ChromeDriver class using the specified
// path to the directory containing ChromeDriver.exe
My code:
IWebDriver drive = new ChromeDriver
("C:\\Documents and Settings\\...\\ApplicationData\\Google\\Chrome\\Application");
And it works just perfect. Thanks All.
Install Selenium.Chrome.WebDriver NuGet package to the project and you will not get the error again.
In Visual Studio, right click the Project, click Manage NuGet Packages... , Search for Selenium.Chrome.WebDriver and click install.
Enjoy Selenium.
Lets assume chromedriver.exe is present in below path: G:\Selenium_Csharp\Jar\chromedriver_win32\chromedriver.exe
To execute your test in Chrome set the path to the directory/folder containing chromedriver.exe without selecting chromedriver.exe file name.
driver = new ChromeDriver("G:\\Selenium_Csharp\\Jar\\chromedriver_win32");
driver.Url ="http://www.gmail.com";
driver.Manage().Window.Maximize();
OR
driver = new ChromeDriver(#"G:\Selenium_Csharp\\Jar\\chromedriver_win32");
driver.Url ="http://www.gmail.com";
driver.Manage().Window.Maximize();
This is the error i see:
OpenQA.Selenium.DriverServiceNotFoundException: The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable.
I resolved this problem by specifying the 'testsettings' argument in the command to run the unit tests.
E.g.
E:\Development\SampleProject\SampleProject.MvcWebApp\SampleProject.MvcWebApp.JavaScriptUnitTests\JavaScriptUnitTests\bin\Debug>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /testcontainer:JavaScriptUnitTests.dll /category:"JavaScriptUnitTests" /testsettings:..\..\..\Local.Testsettings /resultsfile:..\..\..\..\..\MsTestResults\SampleProject.MvcWebApp.JavaScript.Tests.trx
I use "/testsettings:......\Local.Testsettings" because the Local.testsettings file is 4 levels higher than the level where I am executing this command. You should change it accordingly.
This is the command used in ccnet.config file
<exec>
<executable>C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe</executable>
<baseDirectory>SampleProject.MvcWebApp\SampleProject.MvcWebApp.JavaScriptUnitTests\JavaScriptUnitTests\bin\Debug</baseDirectory>
<buildArgs>/testcontainer:JavaScriptUnitTests.dll /category:"JavaScriptUnitTests" /testsettings:..\..\..\Local.Testsettings /resultsfile:..\..\..\..\..\MsTestResults\SampleProject.MvcWebApp.JavaScript.Tests.trx</buildArgs>
<successExitCodes>0</successExitCodes>
</exec>