-
Notifications
You must be signed in to change notification settings - Fork 150
Parameter 'browser' is required by @Configuration on method setUp but has not been marked @Optional or defined #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi meetparag81, |
Thank you! |
Hi,
Please find below code format in Testng.xml file:
|
@meetparag81 In Testng.xml file use standartd DTD type its causing the problem. In my case I was getting same problem as mentioned in the main question, Testng.xml file was generated at runtime and it was missing the below DTD after adding this to the Testng.xml the problem gone away
|
Hey, I am also getting the same error though everything is perfect as mentioned by you guys!! |
@KaustuvTalukdar can you share the code snippet/repo for this |
Hey @RohanImmanuel, thanks a lot for answering. I have got my issue resolved now!! Many thanks. |
Hey, I am also getting the same error though everything is perfect. Please Help. |
Hi @AutomationBatch2019, can you share the code snippet/repo for your test? |
public static WebDriver driver;
TestNG.xml
i am using this with Maven |
From the shared snippet, it looks like you are having issues initiating browser drivers on your local system.
This repository contains sample code to run tests on BrowserStack's cloud infrastructure using TestNG. You will find it more helpful to raise a new issue here: |
Hey, Rohanlmmanuel my issue has been resolved |
Thankyou So much |
@francisf this issue can be closed |
I would like to reiterate what I had said earlier on this thread here: #10 (comment) This repository contains sample code to run tests on BrowserStack's cloud infrastructure using TestNG. From your shared screenshots, it looks like you are having issues initiating browser drivers on your local system. You will find it more helpful to raise a new issue here: |
@RohanImmanuel Please i need your help i am having the same here as mentioned above kindly help. |
My Xml file
|
Hey @bhange24 @anixumoh Why is it so? If I run through testNG XML file it works fine but does not work when I run through Class.java file. But it should be working in both the cases right? |
@RohanImmanuel i have executed the XML file too error still persist.. i have shared my sample repo .. Hope to get this sorted.. Thanks |
You are right its should run irrespective where you execute it. because its runs with TestNG |
1 similar comment
You are right its should run irrespective where you execute it. because its runs with TestNG |
@anixumoh How to run the same from class file then? It is still not working for me. I keep getting this error when run from java file |
@anixumoh this repo implements a custom BrowserStackTestNGTest class from which all the tests extend. This class has the function setUp configured as the "@BeforeMethod" this function requires two parameters "config_file" and "environment" which are defined in the *.testng.xml files and hence if you try to execute the java files directly you will encounter the error as mentioned above. |
i am getting this error org.testng.TestNGException: My base class public class AdminBaseControl
System.setProperty(chrome_key,chrome_value);
} my testclass public class TestLoginPages extends AdminBaseControl
} my testng.xml |
parameter 'browser' is required by beforeclass on method setup but has not been marked @optional or defined. Please help me. This is my Base Class package testBase; public class BaseClass
} This is my Test Class package testCases; import java.io.IOException; import org.testng.Assert; public class TC_001_AccountRegistration extends BaseClass
} This is my Testng.xml
|
hey @Vanda240 could you please refer to this solution - #10 (comment) Also, if that does not work out please reach out to - "https://www.browserstack.com/contact?ref=footer" |
I refer to that solution but it didn't work. |
I am also facing the same problem. Can anyone help please! |
Can you please share a sample code snippet of the test you are trying to execute. Thanks. |
HI Guys, I facing the same error in my ci/cd pipeline ![]() Can someone please let me know the solution Below is my playwright.yml file name: Website Automation schedule:# Run this workflow at 3:00 UTC (7:00 GST) from Monday till Friday- cron: '0 3 * * 1-5'workflow_dispatch:
|
Kindly raise a support ticket by sending an email to [[email protected]]or via Contact Us (https://www.browserstack.com/contact). |
Hello,
I am getting "Parameter 'browser' is required by @configuration on method setUp but has not been marked @optional or defined" message while running my test class
I have extended my base class to test class as well as I have added browser and url values in testng xml
Please refer code below
Base class
public class Baseclass_1
{
public static WebDriver driver;
===================================================================
Test class
public class FBTestnew extends Baseclass_1
{
WebDriver driver;
}
Testng xml
FAILED CONFIGURATION: @BeforeClass setUp
org.testng.TestNGException:
Parameter 'browser' is required by @configuration on method setUp but has not been marked @optional or defined
Where as on running testng by executing Run As TestNG Suite, following error seen.
[RemoteTestNG] detected TestNG version 6.8.0
[TestNG] Running:
G:\Javaprogramming\Maven2\testng.xml
Parameterization Test Suite
Total tests run: 0, Failures: 0, Skips: 0
Can Anyone help me?
The text was updated successfully, but these errors were encountered: