fix Diff: DemoQA
This commit is contained in:
parent
5b4b968e77
commit
721e956410
7
.idea/codeStyles/Project.xml
Normal file
7
.idea/codeStyles/Project.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<ScalaCodeStyleSettings>
|
||||||
|
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
|
||||||
|
</ScalaCodeStyleSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
||||||
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
6
.idea/git_toolbox_blame.xml
Normal file
6
.idea/git_toolbox_blame.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GitToolBoxBlameSettings">
|
||||||
|
<option name="version" value="2" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@ -8,7 +8,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_23" default="true" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package zacksolutions.SeleniumPractice;
|
||||||
|
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import org.openqa.selenium.By;
|
||||||
|
import org.openqa.selenium.WebDriver;
|
||||||
|
import org.openqa.selenium.WebElement;
|
||||||
|
import org.openqa.selenium.chrome.ChromeDriver;
|
||||||
|
import org.openqa.selenium.chrome.ChromeOptions;
|
||||||
|
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||||
|
import org.openqa.selenium.firefox.FirefoxOptions;
|
||||||
|
import org.openqa.selenium.remote.RemoteWebDriver;
|
||||||
|
import org.testng.annotations.AfterTest;
|
||||||
|
import org.testng.annotations.BeforeTest;
|
||||||
|
import org.testng.annotations.Parameters;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ToolsTextTest
|
||||||
|
*/
|
||||||
|
public class ToolsTextTest {
|
||||||
|
|
||||||
|
public WebDriver driver;
|
||||||
|
|
||||||
|
@BeforeTest
|
||||||
|
@Parameters("Browser")
|
||||||
|
public void Setup(String browser) {
|
||||||
|
if (browser.equalsIgnoreCase("Chrome")) {
|
||||||
|
/*
|
||||||
|
ChromeOptions options = new ChromeOptions();
|
||||||
|
try {
|
||||||
|
driver = new RemoteWebDriver(new URL("http://192.168.1.215:4444/wd/hub"), options);
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
System.getProperty("web-driver.chrome", "user.dir" + "/InterviewCodingQuestionsQA/Drivers/chromedriver");
|
||||||
|
driver = new ChromeDriver();
|
||||||
|
} if (browser.equalsIgnoreCase("FireFox")) {
|
||||||
|
/*
|
||||||
|
FirefoxOptions options = new FirefoxOptions();
|
||||||
|
try {
|
||||||
|
driver = new RemoteWebDriver(new URL("http://192.168.1.215:4444/wd/hub"), options);
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
// TODO: handle exception
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
System.getProperty("web-driver.gecko", ("user.dir") + "InterviewCodingQuestionsQA/Drivers/geckodriver");
|
||||||
|
driver = new FirefoxDriver();
|
||||||
|
}
|
||||||
|
driver.get("https://demoqa.com/text-box");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void TextBox() {
|
||||||
|
WebElement fullName = driver.findElement(By.id("userName"));
|
||||||
|
fullName.sendKeys("Desmond Hume");
|
||||||
|
WebElement email = driver.findElement(By.xpath("//input[@id='userEmail']"));
|
||||||
|
email.sendKeys("desmondhume41@island.com");
|
||||||
|
WebElement address = driver.findElement(By.id("currentAddress"));
|
||||||
|
address.sendKeys("4815 16 The Swan Ave # 2342");
|
||||||
|
WebElement parmanentAddress = driver.findElement(By.xpath("//textarea[@id='permanentAddress']"));
|
||||||
|
parmanentAddress.sendKeys("4815 16 The Swan Ave # 2342");
|
||||||
|
driver.findElement(By.cssSelector("#submit")).click();
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterTest
|
||||||
|
public void tearDown() throws InterruptedException {
|
||||||
|
Thread.sleep(5000);
|
||||||
|
driver.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
16
testng.xml
16
testng.xml
@ -1,22 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
||||||
<suite name="All Test Suite" parallel="tests">
|
<suite name="All Test Suite" parallel="tests">
|
||||||
<test verbose="2" preserve-order="true" name="testOnFireFox">
|
<test verbose="2" preserve-order="true" name="TextFieldTextwithCrhome">
|
||||||
<parameter name="Browser" value="FireFox"/>
|
<parameter name="Browser" value="Chrome"/>
|
||||||
<classes>
|
<classes>
|
||||||
<class name="zacksolutions.AutomateGiteaLoginTest">
|
<class name="zacksolutions.SeleniumPractice.ToolsTextTest">
|
||||||
<methods>
|
<methods>
|
||||||
<include name="giteaLogin"/>
|
<include name="TextBox"/>
|
||||||
</methods>
|
</methods>
|
||||||
</class>
|
</class>
|
||||||
</classes>
|
</classes>
|
||||||
</test>
|
</test>
|
||||||
<test verbose="2" preserve-order="true" name="testOnChrome">
|
<test verbose="2" preserve-order="true" name="TextFieldTextwithFireFox">
|
||||||
<parameter name="Browser" value="Chrome"/>
|
<parameter name="Browser" value="FireFox"/>
|
||||||
<classes>
|
<classes>
|
||||||
<class name="zacksolutions.AutomateGiteaLoginTest">
|
<class name="zacksolutions.SeleniumPractice.ToolsTextTest">
|
||||||
<methods>
|
<methods>
|
||||||
<include name="giteaLogin"/>
|
<include name="TextBox"/>
|
||||||
</methods>
|
</methods>
|
||||||
</class>
|
</class>
|
||||||
</classes>
|
</classes>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user