Code Refined to Iterate and Fill Other Quests and Quest Rewards

This commit is contained in:
Arul 2025-08-09 01:17:31 +05:30
parent 983bb544a8
commit fc401b03c9
10 changed files with 20 additions and 173 deletions

3
create-quests Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
/usr/bin/mvn test

View File

@ -47,6 +47,7 @@ public static void fillQuestInputsAndRewards(
WebElement titleElement,
WebElement descElement,
String createQuest,
WebElement createCustomQuest,
List<List<String>> questData,
List<String> dropdownXPaths,
List<List<String>> dropdownOptionsPerRow // each row has a list of dropdown/input values
@ -112,11 +113,13 @@ public static void fillQuestInputsAndRewards(
}
}
sleepInSeconds(4);
//Click Create Quest Button
//scrollIntoView(driver, createQuest);
//checkWebElement(createQuest);
sleepInSeconds(2);
clickElementByXPathJS(driver, createQuest);
sleepInSeconds(2);
if(rowIndex + 1 < questData.size()){
click(createCustomQuest);
}
}

View File

@ -72,7 +72,7 @@ public class Quests {
// Wait for the element to be clickable
ReusableFunctions.waitForElementToBeVisible(driver, questTitle, 5);
ReusableFunctions.waitForElementToBeVisible(driver, questDescription, 5);
ReusableFunctions.fillQuestInputsAndRewards(driver, questTitle, questDescription, createQuestBtnXpath, ExcelUtils.fetchQuestDataByColumns("Quests"), dropdownXpathList, ExcelUtils.fetchQuestDropdownOptions("Quests"));
ReusableFunctions.fillQuestInputsAndRewards(driver, questTitle, questDescription, createQuestBtnXpath, createCustomQuest, ExcelUtils.fetchQuestDataByColumns("Quests"), dropdownXpathList, ExcelUtils.fetchQuestDropdownOptions("Quests"));
}
}

File diff suppressed because one or more lines are too long

4
sync-cookies Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
cp ~/solo-level-app-persistance-wrapper/storage.json . && cp ~/solo-level-app-persistance-wrapper/cookies.data .

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,38 +1,4 @@
-------------------------------------------------------------------------------
Test set: com.ghost.temple.TestRunner
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 37.542 sec <<< FAILURE!
Open Solo Leveling page and click Add Quest(Solo Leveling Quest Management) Time elapsed: 37.186 sec <<< ERROR!
org.openqa.selenium.NoSuchElementException: Unable to locate element: //textarea[@id='description']
For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.0-37-amd64', java.version: '17.0.15'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Command: [3048fb56-1735-406c-85ec-9b3381db9a0a, findElement {value=//textarea[@id='description'], using=xpath}]
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 139.0.1, moz:accessibilityChecks: false, moz:buildID: 20250529122813, moz:geckodriverVersion: 0.36.0, moz:headless: false, moz:platformVersion: 6.1.0-37-amd64, moz:processID: 57582, moz:profile: /tmp/rust_mozprofilewxJHKT, moz:shutdownTimeout: 60000, moz:webdriverClick: true, moz:windowless: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, userAgent: Mozilla/5.0 (X11; Linux x86...}
Session ID: 3048fb56-1735-406c-85ec-9b3381db9a0a
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:190)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518)
at org.openqa.selenium.remote.ElementLocation$ElementFinder$2.findElement(ElementLocation.java:165)
at org.openqa.selenium.remote.ElementLocation.findElement(ElementLocation.java:59)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:355)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:349)
at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement(DefaultElementLocator.java:68)
at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:38)
at jdk.proxy2/jdk.proxy2.$Proxy24.clear(Unknown Source)
at com.ghost.temple.ReusableFunctions.fillInput(ReusableFunctions.java:182)
at com.ghost.temple.ReusableFunctions.fillQuestInputsAndRewards(ReusableFunctions.java:91)
at com.ghost.temple.pages.Quests.createQuests(Quests.java:75)
at com.ghost.temple.stepdefs.QuestsStepDefs.i_fill_all_the_quests_from_excel(QuestsStepDefs.java:24)
at ✽.I fill all the quests from Excel(file:///home/arul/solo-level-app-automation/src/test/resources/features/questCreator.feature:6)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 82.048 sec