My name is Niraj Gupta having 15+ Exp. in automation using multiple tools like QTP/UFT, Selenium Webdriver, cucumber, Jmeter, karate, Protractor, Cypress, TestCafe, WebDriverIO HttpClient, Restassured..etc.In this channel you will find video on various automation topic.
Пікірлер
do we need to call that pdf class anywhere?
Yes.Sorry I missed in video. In pom.xml you need to call. Just add this plugin under build-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.6.0</version> <executions> <execution> <id>first-execution</id> <phase>install</phase> <goals> <goal>java</goal> </goals> <configuration> <classpathScope>test</classpathScope> <mainClass>com.automation.util.PDFReport_Parallel_Execution</mainClass> </configuration> </execution> </executions> </plugin>
hi i tried to automatically run the failed cases but rerun is getting executed when i gave forkcount like showing in video?
@@jayaranjitha8275 fork is required otherwise since 1 thread will run first runner class and second will pick rerun
But the question is how to send this report in gmail as it create multiple html file and cs files which are interdependent. We could not send a single html file in Gmail, we need to send a whole folder. After creating a zip for this folder gmail not allow to send it... So what's the solution, how can we send this report in Gmail?
You can zip and send in gmail.its possible send zip file in gmail
bhai typo error thik krdo header mai ( extends--------> extent )
5:10 5:12
Getting exception - Cucumber. runtime.CucumberException : No backends were found.
I am also facing same error
Excellent
Why your using info.cukes it is deprecated right?
Yes.it is.company got merged with io.cucumber
Ma file upload karta hun to samny upload s are disabled a jata ha please help me
Not getting you question. can you please be more detail
can we send emails without entering password in credentials .....
Not possible how it will validate/authenticate with email server that you are sending mail
hello is there any way I can embed the overview feature.html to email notiications? i tired to do it but the formatting and colors are gone
If you attached other folder like css, image, js and front and download all in single folder then formatting and colors will display
Can we validate the only some particular area if thats not an element?
Possible with advanced python
I have 2 runner files- Test runner ( the original runner) and Uecond Runner( for rerunning the failed cases) but on cmd mvn install or mvn test it is picking up the Uecond Runner first. Plz suggest.
I have doubt single feature file maltipul scenarios but I need to excution one speafic order what I will do
while all test cases are passed i got this error The TrueType font null does not contain a 'cmap' table
Hi, I tried to implement this however i am facing error as " No features found at.." Could you please help me on this.?
Your problem is resolved or not i am facing same problem
i was facing difficulty in making the file .... i didnt used .feature there ... now its ok
Hi Niraj, I am executing both runner and then failed rerunner class using TestNG one after the other in single execution. With this my extent report is getting Mixed up with failed scenarios from first run and the re executed scenarios from re-run. Is there any solution to remove failed scenarios if they got passed in second run from report and get clean report with no duplicates
We have to write custom report. let me check on that
Hello sir, will this work for outlook email too
Voice is very low
Hi Niraj I am able to rerun the failed scenario generate report but in report screenshots is missing could you please help me
Check the path of screen shot
Hi after rerun failed test is passed in second attempt but in console its showing as 1 failures,any solution for this
No it will show.since cucumber does not know thats its runing same scenario. It treating 2 scenario
with io.cucumber jar we have scenario.attach(screenshot, "image/png","first") for attaching screenshot for attaching text to scenario scenario.attach("Text key:", " text/plain"," Random String");
scenario. write() method not showing.. I mean no write method. Its showing getName() and wait() , attach() method its showing?
Yes with io.cucumber jar we have scenario.attach(screenshot, "image/png","first") for attaching screenshot for attaching text to scenario scenario.attach("Text key:", " text/plain"," Random String");
Hello, I have the same problem, but upon implementing this solution, it can't run the 2nd runner class which should run the failed test case from the text file, can you help me with this one?
Did you included the second runner class in pom.xml like this--<build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19</version> <configuration> <forkCount>7</forkCount> <reuseForks>true</reuseForks> <includes> <include>**/TestRunner*</include> </includes> </configuration> </plugin> </plugins> </pluginManagement> </build>
After executing failed scenarios, finally build is also getting failed.. Do you have any solution for this? For ex: I ran 2 scenarios in first run and 1 got failed.. then failed scenario is running again and got passed.. But build is getting failed..
the build should not fail if the failed test had passed.check are you you all latest dependency
How can we execute it via Jenkins pipeline .?
you can configure your job in jenkins as like normal job. the surefire plugin will take care of rerun
Hi. I am looking for the solution in GitHub. Due to tag push GitHub is generating webhook. Due to that my build is running in loop. How to prevent the webhook that got generated by tag push?
Voice very low.. Please speak loud
Bro, rerun file got generated. But second runner file is not getting triggered
Very helpful video. Thank you for creating such videos and helping others.
Hello Sir I am using Cucumber framework. I am able to run parallel testing successfully but when I add rerun file in my pom.xml <include>runner rerun</include> and when I try to run in parallel..it is running sequentially not in parallels
It should be run in parallel.check youe pom.xml
@@NirajGupta <forkCount>3</forkCount> <includes<include>runner.java</include> <include>runner_rerun.java</include></includes> I have my POM as above
I will check in weekend
where is code and dependeancy available
driver.get(configProperties.getProperty("BaseUrl")+"/broken_images"); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); List<WebElement> elementList= driver.findElements(By.tagName("img")); for(int i=0;i<elementList.size();i++) { Response response= RestAssured.given().contentType("application/json") .get(elementList.get(i).getAttribute("src")); System.out.println("printt the response code"+response.getStatusCode()); if(elementList.get(i).getAttribute("naturalWidth").equals("0")) { System.out.println("the image is broken"); }else { System.out.println("the image is not broken"); } } use restassured dependency and selenium
@@NirajGupta thanks Bhai
buildNumber how to get dynamically if two reports generated?
you need to write code to parse the html report to get build number
Hello Sir I have integrated rerun concept with jenkins. 1).my runner name is Runner 2).my rerun name is SecondRunner For some reasons my rerun file gets executed first then runner file is executed ...how can I make to run files normally ? My POM first I have mentioned Runner file then SecondRunner file
it should be arphabetical order s come first then R you can give like runner and runnerRerun
Can we have any other value for Key or it shd be the one you have mentioned sir?
Any key of your choice
Any key of your choice
@@NirajGupta , Thank you Sir
The Runner class with latest cucumber jar version 7.6.0 /* private static final Logger LOGGER = LogManager.getLogger(CommonUtil.class); public static WebConnector webConnector = WebConnector.getInstance(); public WebConnector webConnector=WebConnector.getInstance(); WebDriver driver=webConnector.getDriver();*/ package com.automation.action; import java.text.SimpleDateFormat; import java.util.Date; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; import com.github.mkolisnyk.cucumber.runner.ExtendedCucumber; import com.github.mkolisnyk.cucumber.runner.ExtendedCucumberOptions; import com.github.mkolisnyk.cucumber.runner.ExtendedParallelCucumber; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions(features = "src/test/resources/", tags={ "@AddToCart"}, plugin = { "html:target3/cucumber-html-report", "json:target3/cucumber.json", "junit:target3/cucumber.xml" ,"rerun:target/rerun.txt" }, glue = "com.automation" ) public class TestRunner { @BeforeClass public static void beforeClass(){ //For BeforeClass annotation static is compulsory because JVM calls it directly if(System.getProperty("Browser")==null){ System.setProperty("Browser", "chrome"); } if(System.getProperty("headless")==null){ System.setProperty("headless","no"); } if(System.getProperty("ENV")==null){ System.setProperty("ENV", "SIT"); } if(System.getProperty("ExecuteOn")==null){ System.setProperty("ExecuteOn", "null"); } if(System.getProperty("Remote")==null){ System.setProperty("Remote", "yes"); } //for one time driver object initialization //SeleniumUtil.initializeSeleniumConnector(); //SeleniumUtil.getInstance(); SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd hh-mm-ss"); System.setProperty("currentdate", dateFormat.format(new Date())); //SeleniumUtil.cleanFolder(1, "Logs");//delete all except todays } @AfterClass public static void afterClass(){ } }
Hi Sir if u have used cucumber latest versions >6.8.1 please share the video... I am having challenges with cucumber >6.8.1
What chanlleges are you facing
Hi thanks for the session I have put all common stepdefinition in another as a jar sonincan use across multiple projects. But runner class is not picking that step definition. Can U please guide
you need to mention the package path in runner class glue = "com.automation"
Hi , Rerun file is not executing it is showing the initialization error unable to fix that ...can you please share your pom.xml file
Look like some issue with feature file. Is the first runner class running perfectly
Hi Niraj, I am getting error in the below line: props.put("mail.smtp.port", MailSMTPport); It is saying :Cannot resolve symbol 'MailSMTPport'" create local variable MailSMTPport . Please help me with this
MailSMTPPort is port used by your mail server for example in gmail- 25, 465, or 587
How to do this in Katalon Studio?
Showing this error - java.lang.NullPointerException: Cannot invoke "io.cucumber.java.Scenario.log(String)" because "apphooks.CommonStep.scenario" is null how to rectify it
Hi Niraj, in my framework scenarios run with tags and in failedtxt file it is with line no.so when 2nd runner file i run it gives inconsistent error that both tag and line can't be used together..issue is i can't remove either of them.any idea on this?
Can You Paste the rerun.txt file and error
How to rerun failed feature files bro ???
please watch this video--kzread.info/dash/bejne/apl4wcSgYcuXZrA.html&lc=UgwlcWxWpsPP8Z8Ebip4AaABAg
Hello Sir When I give folder name in POM my tests are not running from maven..it runs only when I give one runner file.how to include multiple runner files in POM.xml ? Please help
This is not Automatically Re-Running bro!
Have you created two runner class and mention in pom.xml
totally stuck here net.masterthought.cucumber.ValidationException: None report file was added!
make sure that you have added this plugin to pom.xml <plugin> <groupId>net.masterthought</groupId> <artifactId>maven-cucumber-reporting</artifactId> <version>5.3.0</version> <executions> <execution> <id>execution</id> <phase>verify</phase> <goals> <goal>generate</goal> </goals> <configuration> <projectName>cucumber-jvm-example</projectName> <outputDirectory>${project.build.directory}/cucumber-JVM-reports</outputDirectory> <enableFlashCharts>true</enableFlashCharts> <buildNumber>1</buildNumber> <parallelTesting>false</parallelTesting> <inputDirectory>${project.build.directory}</inputDirectory> <jsonFiles> <jsonFile>**/cucumber.json</jsonFile> </jsonFiles> <testFailureIgnore>true</testFailureIgnore> <buildSuccessOnTestFailure>true</buildSuccessOnTestFailure> </configuration> </execution> </executions> </plugin>
Using masterthought report generation it create 5 to 6 html file and it needs orher cs file supporting files to properly open.. If we send a single html file it will not open... We need to zip the whole folder and then send... But gmail not allowed to send zip file.. Do you have any solution on this?
can we get the source code of this video. It would be nice. Thanks.
docker-compose.xml file version: "3" services: selenium-hub: image: selenium/hub ports: - "4444:4444" environment: GRID_MAX_SESSION: 16 GRID_BROWSER_TIMEOUT: 3000 GRID_TIMEOUT: 3000 #chrome: #image: selenium/node-chrome #depends_on: # - selenium-hub #environment: #HUB_PORT_4444_TCP_ADDR: selenium-hub #HUB_PORT_4444_TCP_PORT: 4444 #NODE_MAX_SESSION: 2 #NODE_MAX_INSTANCES: 2 # volumes: # - /dev/shm:/dev/shm chrome: image: selenium/node-chrome-debug depends_on: - selenium-hub environment: HUB_PORT_4444_TCP_ADDR: selenium-hub HUB_PORT_4444_TCP_PORT: 4444 NODE_MAX_SESSION: 2 NODE_MAX_INSTANCES: 2 firefox: image: selenium/node-firefox depends_on: - selenium-hub environment: HUB_PORT_4444_TCP_ADDR: selenium-hub HUB_PORT_4444_TCP_PORT: 4444 NODE_MAX_SESSION: 4 NODE_MAX_INSTANCES: 4
Pom.xml line 1 error. Can you help me 😭
Please paste the error here
Pom.xml <project xmlns="maven.apache.org/POM/4.0.0" xmlns:xsi="www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="maven.apache.org/POM/4.0.0 maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.SeleniumCumber</groupId> <artifactId>SeleniumCumber</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>SeleniumCumber</name> <url>maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <cucumberversion>1.2.5</cucumberversion> </properties> <build> <plugins> <!-- <plugin> <groupId>com.github.temyers</groupId> <artifactId>cucumber-jvm-parallel-plugin</artifactId> <version>5.0.0</version> <executions> <execution> <id>generateRunners</id> <phase>validate</phase> <goals> <goal>generateRunners</goal> </goals> <configuration> <glue> <package>com.ingcapgemini.wm.common</package> <package>com.ingcapgemini.wm.module1</package> </glue> <featuresDirectory>src/test/resources/featurefile/Module2</featuresDirectory> <cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir> <format>json,html</format> <tags> <tag>@getexamplecount</tag> <tag>~@billing</tag> <tag>@important</tag> <tag>@important,@billing</tag> </tags> </configuration> </execution> </executions> </plugin> --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.6.0</version> <executions> <execution> <id>first-execution</id> <phase>install</phase> <goals> <goal>java</goal> </goals> <configuration> <classpathScope>test</classpathScope> <mainClass>com.automation.util.PDFReport_Parallel_Execution</mainClass> </configuration> </execution> </executions> </plugin> --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19</version> <configuration> <forkCount>7</forkCount> <reuseForks>true</reuseForks> <includes> <include>**/TestRunner.class</include> <include>**/TestRunner2.class</include> <include>**/TestRunner3.class</include> </includes> </configuration> </plugin> <!-- this plugin to generate Jenkin JVM report --> <plugin> <groupId>net.masterthought</groupId> <artifactId>maven-cucumber-reporting</artifactId> <version>5.0.0</version> <executions> <execution> <id>execution</id> <phase>verify</phase> <goals> <goal>generate</goal> </goals> <configuration> <projectName>cucumber-jvm-example</projectName> <outputDirectory>${project.build.directory}/cucumber-JVM-reports</outputDirectory> <enableFlashCharts>true</enableFlashCharts> <buildNumber>42</buildNumber> <parallelTesting>false</parallelTesting> <inputDirectory>${project.build.directory}</inputDirectory> <jsonFiles> <jsonFile>**/cucumber.json</jsonFile> </jsonFiles> <testFailureIgnore>true</testFailureIgnore> <buildSuccessOnTestFailure>true</buildSuccessOnTestFailure> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.8.1</version> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-junit</artifactId> <version>${cucumberversion}</version> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-java</artifactId> <version>${cucumberversion}</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.17</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.17</version> </dependency> <!-- this dependency for consolidated report in parallel execution --> <dependency> <groupId>net.masterthought</groupId> <artifactId>cucumber-reporting</artifactId> <version>3.20.0</version> </dependency> <!-- this is for pdf report fom runner class --> <dependency> <groupId>com.github.mkolisnyk</groupId> <artifactId>cucumber-runner</artifactId> <version>1.3.3</version> </dependency> <!-- to convert HTMl to PDF --> <dependency> <groupId>io.woo</groupId> <artifactId>htmltopdf</artifactId> <version>1.0.5</version> </dependency> <!-- This is the Applitools Selenium Java SDK --> <!-- <dependency> <groupId>com.applitools</groupId> <artifactId>eyes-selenium-java3</artifactId> <version>[3.0.0, 4.0.0)</version> </dependency> --> <dependency> <groupId>com.asprise.ocr</groupId> <artifactId>java-ocr-api</artifactId> <version>[15,)</version> </dependency> <dependency> <groupId>io.github.bonigarcia</groupId> <artifactId>webdrivermanager</artifactId> <version>4.0.0</version> </dependency> <dependency> <groupId>net.sourceforge.tess4j</groupId> <artifactId>tess4j</artifactId> <version>4.5.4</version> </dependency> </dependencies> </project>