Closed MonoAutomation closed 4 years ago
@MonoAutomation , check out testng-all-browsers.xml file and enable parallel parameter in it and select parallel mode to test. You can also enable the tests which are marked as enabled="false"
.
After updating the file, you can run it like any other testng file and the tests will run simultaneously on all the mentioned browser. This is useful to get quick feedback of the tests while running on different browsers at the same time.
Let me know if you still find it difficult to run in parallel.
I enabled in testng-all-browsers.xml but no luck, should I rename it to testng.xml after updates? what purpose we are using "selenium-config.yaml" do I need to change anything here? will this framework supports on Mac OS? bcz I have not seen any browser invoking
@MonoAutomation , I'll create a small documentation about this and update you when it's ready.
In meantime, can you share how are you running the TestNG xml file I mentioned in my previous comment?
BROWSER, appSetting ().getBrowser ().name ())....I don't see any method getBrowser() implementation in appSetting() ..do we need to add this method getBrowser()?
-----parallel xml---- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
I renamed it as testing.xml
@MonoAutomation , you don't have to do this. Wait till I update the README with more details on how to run the tests..
Try going thru the src/test
directory to understand how to write the test OR check the README
where I already did some detailing on how to write the test.
@MonoAutomation , Readme is updated with more details about running the tests, kindly check and let me know if that helped you.
Thank you for updating the doc, but still not getting..if I want to run my tests on different browsers parallelly if I pass CHROME,SAFARI,FIREFOX on config file ...It will throw error because it is accepting only one browser name
@MonoAutomation , to make this more clear, the framework is designed that way only, in config it will accept only one browser at a time. What you can do is, create different test blocks for each browsers in your testng.xml
file and pass the browser name in the test parameter directly, this will override the browser mentioned in the config.
Kindly check the sample testng.xml file where I am running 1st test on local chrome, 2nd test on Selenium Grid Chrome and 3rd test on BrowserStack Chrome.
Similarly there is one more file testng-all-browsers.xml, where I am running test on 4 different browsers.
I have updated as <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
moreover , let me know where all drivers getting stored in the project...its seems having some chrome version problem...so getting Starting ChromeDriver 2.46.628411 (3324f4c8be9ff2f70a05a30ebc72ffb013e1a71e) on port 7911 Only local connections are allowed.
@MonoAutomation , drivers are handled dynamically using WebDriverManager
, The framework will download required driver automatically. Normally the driver is stored in <User>/.m2/repository/webdriver
folder.
Only local connections are allowed.
You can ignore this as it is only warning given by the driver.
Chrome browser not at all launching and after completion of one set of test cases ,execution is stopped and no further execution to run on other browsers like Firefox.....
@MonoAutomation , try running the following testng.xml against my repository,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<listeners>
<listener class-name="com.github.wasiqb.coteafs.listeners.ConfigListener"/>
<listener class-name="com.github.wasiqb.coteafs.listeners.SuiteListener"/>
<listener class-name="com.github.wasiqb.coteafs.listeners.TestListener"/>
<listener class-name="com.github.wasiqb.coteafs.listeners.ExecutionListener"/>
<listener class-name="com.github.wasiqb.coteafs.listeners.DataProviderListener"/>
<listener class-name="com.github.wasiqb.coteafs.listeners.AnnotationTransformer"/>
</listeners>
<test name="Test Local">
<classes>
<class name="com.github.wasiqb.coteafs.selenium.SeleniumTest">
<methods>
<include name="testSignIn"/>
<include name="testNewCustomer"/>
<include name="testEditCustomer"/>
<include name="testNewAccount"/>
<include name="testDeleteAccount"/>
<include name="testDeleteCustomer"/>
</methods>
</class>
</classes>
</test>
</suite>
using the following command in terminal / command line,
mvn clean install
No luck, moreover am using Mac and IntelliJ....after updates..getting the below error (Driver info: chromedriver=2.46.628411 (3324f4c8be9ff2f70a05a30ebc72ffb013e1a71e),platform=Mac OS X 10.14.6 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
still chrome not being launched
@MonoAutomation , this framework works on any OS (Mac, Windows and Linux) and on any browser (Chrome, Firefox, Edge, IE and Safari). I am not sure how you are trying execute the tests.
I would suggest you to share the following,
If you are still in doubt if this framework really works, you can check out the build pipeline where the tests are being executed on Linux Docker container.
I am working on my local machine and please let me know what are these and where is referring "coteafs.selenium.config" String COTEAFS_CONFIG_KEY = "coteafs.selenium.config"; /**
@MonoAutomation , try writing some tests so you'll understand better. Also read complete README file, it says what coteafs.selenium.config
does.
@WasiqB ,on Firefox its working fine but chrome browser not invoking....chrome driver session is starting but browser not opened Need some info, suppose if I add dataset.yaml config file by creating one more folder repository under resources, do I need to change or write any code or by fault our framework will take care of it.
Sir, I have verified mysids, parallel run not working , it works only on one browser at a time then run will stop. can you help me how and where I can fix this on your framework?
@MonoAutomation , kindly put your project on GitHub and share it's URL. I'll check it out and help you fix the issue.
Sir,i don't have any separate project..am trying with your project with some additional test cases...what I have observed here if run as testng.xml ...parallel execution is done but if run as seleniumtests not executed..so when ever we want parallel run..then need to choose testing.xml as runner
That's how it should be done, because parallel setting is defined in testng.xml file.
Thank you, I thought we are handling testing.xml through the framework. have on more on report part , I can see we are using epam.reportportal to generate report but after the execution no where the report is getting generated. in this do I need to to any additional setup or configuration?
Sir, is there way to know current running browser name ...getbrowser()..like..I wanted to check on different methods...plz help
What's your use case for getting currently running browser name?
As a part of parallel execution, I want to know on which browser driver going to perform actions before each class/method
I'll check and update you on this.
Thank you sir
Sir,Is there any way to read any additional data files to read(.yaml) along with default files(.yaml),I am planning to maintain my test data as well in .yaml files.
under resources/testdata/xxxx.yaml I want to read this data before the class. can you please help in this?
Its good to see the framework but I am not understanding how it can be useful for parallel testing(on different browsers) can you add some tests on this and put some details how e we can use this framework for parallel testing