>cd <eclipse-workspace>
>mvn archetype:generate -DgroupId=JavaSelenium -DartifactId=TechnicalInterview -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
>cd <root directory of the new project>
>mvn eclipse:eclipse
- Open Eclipse
- Files ==> Import...
- Select ==> Maven//Existing Maven Project ==> Next
- Maven Projects ==> Browse ==> Project Root Folder ==> Select Folder ==> Finish
- The project will be imported into Eclipse shortly.
- src/test/java - All the test cases created here
- src/main/java - All the utilities, base objects, data and etc.
- pom.xml - the maven configure file
-
Selenium Dependency ==> search "Selenium Maven Information"
<dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.141.59</version> </dependency>
-
TestNG Dependency ==> search "TestNG Maven Dependency"
<dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.8</version> <scope>test</scope> </dependency>
-
Save "pom.xml" will get all the dependencies added to the project local repository.
if (browserName == "chrome") - wrong. shouldn't use "==".
extract the value from property file, need use browserName.equalsTo("String");
- == is a reference comparison, i.e. both objects point to the same memory location
- .equals() evaluates to the comparison of values in the objects
- each line ended without semicolon otherwise will cause the problem.
if (browserName == "chrome") - wrong. shouldn't use "==".
extract the value from property file, need use browserName.equalsTo("String");
- == is a reference comparison, i.e. both objects point to the same memory location
- .equals() evaluates to the comparison of values in the objects
- each line ended without semicolon otherwise will cause the problem.