Discussion:
[selenium-users] Repeating test from step X
Resident
2018-12-05 11:29:24 UTC
Permalink
Hi!

Might some one can guide me, how i could repeat my test in the end, from
step X

Example:

High level flow:
Login to page
Navigate to location A
Execute repeating activity Z time.


1) i login into the system.
WebElement valueInput = driver.findElement(By.name("ik"));
valueInput.click();
valueInput.sendKeys("1234");

WebElement value2Input = driver.findElement(By.name("tel"));
value2Input.click();
value2Input.sendKeys("12345");

WebElement ttaEnterInput =
driver.findElement(clavalueame("submit"));
ttaEnterInput.click();

2) Navigate to required interface.

WebElement Enable = driver.findElement(By.id("input34"));
Enable.click();

WebElement enterAs = driver.findElement(clavalueame("forward"));
enterAs.click();

3) repeating flow. that should get looped
String dirPath = "C://YEAR_reports";
File dir = new File(dirPath);
String[] files = dir.list();
if (files.length == 0) {
System.out.println("The directory is empty");
} else {
for (String aFile : files) {
System.out.println(aFile);
}
}
//Strip away file extension
String companyName = files[0].replaceFirst(".xml$", "");

WebElement DropdownValueBeforeSelect =
driver.findElement(By.tagName("option"));
String CurrentDropDownSelections =
DropdownValueBeforeSelect.getText();
System.out.println(CurrentDropDownSelections);

WebElement SaveSelectedFile =
driver.findElement(By.name("saveButton"));
SaveSelectedFile.click();
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
// CloseTab, button may be out of visible area, just send Enter.
WebElement CloseTab = driver.findElement(By.name("closeButton"));
CloseTab.sendKeys(Keys.ENTER);

So in the end after CloseTab.Enter is sent..
it should start again with String dirPath = "C://YEAR_reports"; Flow..
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/af8bd3a0-22d6-4643-9fc7-a72d57f73d9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Resident
2018-12-06 18:43:25 UTC
Permalink
Solved.
Post by Resident
Hi!
Might some one can guide me, how i could repeat my test in the end, from
step X
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/45005633-e156-4ad7-9eb2-7afe7639eacf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...