Android + Appium + ArrayList: How to pass ArrayList between several activities
up vote
0
down vote
favorite
I'm looking for help with the following
Task: To open screen with exchange parameters:
screen example
To save parameters such as names of cities, date and flight class as strings. Click on search exchange button and compare data on screen with results if it's equal to saved parameters, then select a result and then compare data on summary screen.
So i need to pass data from first screen through two others.
What did i tried:
I had created ArrayList inside class which described exchange screen:
public class ExchangeRoutePageObject extends MainPageObject
public ExchangeRoutePageObject(AppiumDriver driver)super(driver);
public ArrayList<String> saveParameters()
ArrayList<String> exchangeParameters = new ArrayList<>();
exchangeParameters.add(getElementValue(CITY_ORIGIN_FIELD_TEXT));
exchangeParameters.add(getElementValue(CITY_DESTINATION_FIELD_TEXT));
exchangeParameters.add(getElementValue(DATE_FIELD));
exchangeParameters.add(getCurrentClass());
return exchangeParameters;
I'll skip code with button click scenario.
So, when i get results screen, I tried to get value from ArrayList but i get the test fail caused xpath from exchange screen (ExchangeRoutePageObject class) are not present on exchange results screen (ExchangeResultsPageObject class)
public class ExchangeResultsPageObject extends MainPageObject {
ExchangeResultsPageObject(AppiumDriver driver)super(driver);
private void checkClass(){
ExchangeRoutePageObject ExchangeRoutePageObject = new ExchangeRoutePageObject(driver);
ArrayList exchangeParameters = ExchangeRoutePageObject.saveParameters();
System.out.println(exchangeParameters.get(3));
Question What do i need to do? I saw that intent with activities are used for this case, but i don't understand how to use it with appium test.
java android arrays arraylist appium
add a comment |
up vote
0
down vote
favorite
I'm looking for help with the following
Task: To open screen with exchange parameters:
screen example
To save parameters such as names of cities, date and flight class as strings. Click on search exchange button and compare data on screen with results if it's equal to saved parameters, then select a result and then compare data on summary screen.
So i need to pass data from first screen through two others.
What did i tried:
I had created ArrayList inside class which described exchange screen:
public class ExchangeRoutePageObject extends MainPageObject
public ExchangeRoutePageObject(AppiumDriver driver)super(driver);
public ArrayList<String> saveParameters()
ArrayList<String> exchangeParameters = new ArrayList<>();
exchangeParameters.add(getElementValue(CITY_ORIGIN_FIELD_TEXT));
exchangeParameters.add(getElementValue(CITY_DESTINATION_FIELD_TEXT));
exchangeParameters.add(getElementValue(DATE_FIELD));
exchangeParameters.add(getCurrentClass());
return exchangeParameters;
I'll skip code with button click scenario.
So, when i get results screen, I tried to get value from ArrayList but i get the test fail caused xpath from exchange screen (ExchangeRoutePageObject class) are not present on exchange results screen (ExchangeResultsPageObject class)
public class ExchangeResultsPageObject extends MainPageObject {
ExchangeResultsPageObject(AppiumDriver driver)super(driver);
private void checkClass(){
ExchangeRoutePageObject ExchangeRoutePageObject = new ExchangeRoutePageObject(driver);
ArrayList exchangeParameters = ExchangeRoutePageObject.saveParameters();
System.out.println(exchangeParameters.get(3));
Question What do i need to do? I saw that intent with activities are used for this case, but i don't understand how to use it with appium test.
java android arrays arraylist appium
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm looking for help with the following
Task: To open screen with exchange parameters:
screen example
To save parameters such as names of cities, date and flight class as strings. Click on search exchange button and compare data on screen with results if it's equal to saved parameters, then select a result and then compare data on summary screen.
So i need to pass data from first screen through two others.
What did i tried:
I had created ArrayList inside class which described exchange screen:
public class ExchangeRoutePageObject extends MainPageObject
public ExchangeRoutePageObject(AppiumDriver driver)super(driver);
public ArrayList<String> saveParameters()
ArrayList<String> exchangeParameters = new ArrayList<>();
exchangeParameters.add(getElementValue(CITY_ORIGIN_FIELD_TEXT));
exchangeParameters.add(getElementValue(CITY_DESTINATION_FIELD_TEXT));
exchangeParameters.add(getElementValue(DATE_FIELD));
exchangeParameters.add(getCurrentClass());
return exchangeParameters;
I'll skip code with button click scenario.
So, when i get results screen, I tried to get value from ArrayList but i get the test fail caused xpath from exchange screen (ExchangeRoutePageObject class) are not present on exchange results screen (ExchangeResultsPageObject class)
public class ExchangeResultsPageObject extends MainPageObject {
ExchangeResultsPageObject(AppiumDriver driver)super(driver);
private void checkClass(){
ExchangeRoutePageObject ExchangeRoutePageObject = new ExchangeRoutePageObject(driver);
ArrayList exchangeParameters = ExchangeRoutePageObject.saveParameters();
System.out.println(exchangeParameters.get(3));
Question What do i need to do? I saw that intent with activities are used for this case, but i don't understand how to use it with appium test.
java android arrays arraylist appium
I'm looking for help with the following
Task: To open screen with exchange parameters:
screen example
To save parameters such as names of cities, date and flight class as strings. Click on search exchange button and compare data on screen with results if it's equal to saved parameters, then select a result and then compare data on summary screen.
So i need to pass data from first screen through two others.
What did i tried:
I had created ArrayList inside class which described exchange screen:
public class ExchangeRoutePageObject extends MainPageObject
public ExchangeRoutePageObject(AppiumDriver driver)super(driver);
public ArrayList<String> saveParameters()
ArrayList<String> exchangeParameters = new ArrayList<>();
exchangeParameters.add(getElementValue(CITY_ORIGIN_FIELD_TEXT));
exchangeParameters.add(getElementValue(CITY_DESTINATION_FIELD_TEXT));
exchangeParameters.add(getElementValue(DATE_FIELD));
exchangeParameters.add(getCurrentClass());
return exchangeParameters;
I'll skip code with button click scenario.
So, when i get results screen, I tried to get value from ArrayList but i get the test fail caused xpath from exchange screen (ExchangeRoutePageObject class) are not present on exchange results screen (ExchangeResultsPageObject class)
public class ExchangeResultsPageObject extends MainPageObject {
ExchangeResultsPageObject(AppiumDriver driver)super(driver);
private void checkClass(){
ExchangeRoutePageObject ExchangeRoutePageObject = new ExchangeRoutePageObject(driver);
ArrayList exchangeParameters = ExchangeRoutePageObject.saveParameters();
System.out.println(exchangeParameters.get(3));
Question What do i need to do? I saw that intent with activities are used for this case, but i don't understand how to use it with appium test.
java android arrays arraylist appium
java android arrays arraylist appium
asked Nov 9 at 19:19
Sergey Bykov
61
61
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Several months ago I used this type of approach to pass parameter between multiple activities
SharedPreferences themeInfo = getSharedPreferences("THEMECONFIG",0);
Try to take a look at this answer on stack. This SITE might help
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Several months ago I used this type of approach to pass parameter between multiple activities
SharedPreferences themeInfo = getSharedPreferences("THEMECONFIG",0);
Try to take a look at this answer on stack. This SITE might help
add a comment |
up vote
0
down vote
Several months ago I used this type of approach to pass parameter between multiple activities
SharedPreferences themeInfo = getSharedPreferences("THEMECONFIG",0);
Try to take a look at this answer on stack. This SITE might help
add a comment |
up vote
0
down vote
up vote
0
down vote
Several months ago I used this type of approach to pass parameter between multiple activities
SharedPreferences themeInfo = getSharedPreferences("THEMECONFIG",0);
Try to take a look at this answer on stack. This SITE might help
Several months ago I used this type of approach to pass parameter between multiple activities
SharedPreferences themeInfo = getSharedPreferences("THEMECONFIG",0);
Try to take a look at this answer on stack. This SITE might help
answered Nov 9 at 20:37
Apuna12
5819
5819
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232049%2fandroid-appium-arraylist-how-to-pass-arraylist-between-several-activities%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown