how to verify array list WebElement in selenium greater and lowest valueHow can I concatenate two arrays in Java?How to create a generic array in Java?How to get an enum value from a string value in Java?How to get the last value of an ArrayListHow do I determine whether an array contains a particular value in Java?How do I declare and initialize an array in Java?Converting array to list in JavaHow to take screenshot with Selenium WebDriverGet HTML Source of WebElement in Selenium WebDriver using PythonConvert list to array in Java
What is this called? Old film camera viewer?
Infinite dials to reset ever?
Multiplicative persistence
copy and scale one figure (wheel)
Count the occurrence of each unique word in the file
The probability of Bus A arriving before Bus B
What was this official D&D 3.5e Lovecraft-flavored rulebook?
2.8 Why are collections grayed out? How can I open them?
Freedom of speech and where it applies
What will be next at the bottom row and why?
Removing files under particular conditions (number of files, file age)
Is this toilet slogan correct usage of the English language?
The screen of my macbook suddenly broken down how can I do to recover
Terse Method to Swap Lowest for Highest?
Loading commands from file
Are the IPv6 address space and IPv4 address space completely disjoint?
Problem with TransformedDistribution
What should you do when eye contact makes your subordinate uncomfortable?
Travelling outside the UK without a passport
Is (0,1] a closed or open set?
How to indicate a cut out for a product window
How to create ADT in Haskell?
Are paving bricks differently sized for sand bedding vs mortar bedding?
How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?
how to verify array list WebElement in selenium greater and lowest value
How can I concatenate two arrays in Java?How to create a generic array in Java?How to get an enum value from a string value in Java?How to get the last value of an ArrayListHow do I determine whether an array contains a particular value in Java?How do I declare and initialize an array in Java?Converting array to list in JavaHow to take screenshot with Selenium WebDriverGet HTML Source of WebElement in Selenium WebDriver using PythonConvert list to array in Java
website is dark sky and I want to verify current temp is greater or less than temps from timeline. I used array list. I need to get current temp and compare it with them. Thank you. I couldn’t do that. Do u have any idea for this. Thnx.
ArrayList<WebElement> list = new ArrayList<>(SharedSD.getDriver( ).findElements(greaterOrLess));
java selenium arraylist automated-tests
add a comment |
website is dark sky and I want to verify current temp is greater or less than temps from timeline. I used array list. I need to get current temp and compare it with them. Thank you. I couldn’t do that. Do u have any idea for this. Thnx.
ArrayList<WebElement> list = new ArrayList<>(SharedSD.getDriver( ).findElements(greaterOrLess));
java selenium arraylist automated-tests
Duplicate of stackoverflow.com/questions/55274122/…
– Fenio
2 days ago
1
Possible duplicate of verify current temp is not greater or less then temps from daily timeline
– Guy
2 days ago
add a comment |
website is dark sky and I want to verify current temp is greater or less than temps from timeline. I used array list. I need to get current temp and compare it with them. Thank you. I couldn’t do that. Do u have any idea for this. Thnx.
ArrayList<WebElement> list = new ArrayList<>(SharedSD.getDriver( ).findElements(greaterOrLess));
java selenium arraylist automated-tests
website is dark sky and I want to verify current temp is greater or less than temps from timeline. I used array list. I need to get current temp and compare it with them. Thank you. I couldn’t do that. Do u have any idea for this. Thnx.
ArrayList<WebElement> list = new ArrayList<>(SharedSD.getDriver( ).findElements(greaterOrLess));
java selenium arraylist automated-tests
java selenium arraylist automated-tests
edited 2 days ago
Bob Lerry
asked 2 days ago
Bob LerryBob Lerry
105
105
Duplicate of stackoverflow.com/questions/55274122/…
– Fenio
2 days ago
1
Possible duplicate of verify current temp is not greater or less then temps from daily timeline
– Guy
2 days ago
add a comment |
Duplicate of stackoverflow.com/questions/55274122/…
– Fenio
2 days ago
1
Possible duplicate of verify current temp is not greater or less then temps from daily timeline
– Guy
2 days ago
Duplicate of stackoverflow.com/questions/55274122/…
– Fenio
2 days ago
Duplicate of stackoverflow.com/questions/55274122/…
– Fenio
2 days ago
1
1
Possible duplicate of verify current temp is not greater or less then temps from daily timeline
– Guy
2 days ago
Possible duplicate of verify current temp is not greater or less then temps from daily timeline
– Guy
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
DarkSky considered for test:

Python Script on darksky:

Just converted the python code to java
driver.get("https://darksky.net/forecast/40.7127,-74.0059/us12/en");
String currentTemp = driver.findElement(By.cssSelector(".summary.swap")).getText();
System.out.println("Current Temp:" + currentTemp);
List<WebElement> tempsInTimeLine = driver.findElements(By.cssSelector(".temps span:last-child"));
int temp = Integer.parseInt(currentTemp.substring(0, 2));
int highestInTimeLine = temp;
int lowestInTimeLine = temp;
for (WebElement tempInTime: tempsInTimeLine)
String sLIneTemp = tempInTime.getText();
int lineTemp = Integer.parseInt(sLIneTemp.substring(0, 2));
if (lineTemp > highestInTimeLine)
highestInTimeLine = lineTemp;
if (lineTemp < lowestInTimeLine )
lowestInTimeLine = lineTemp;
System.out.println("Highest Temp:" + Integer.toString(highestInTimeLine));
System.out.println("Lowest Temp:" + Integer.toString(lowestInTimeLine ));
it did not work. How can we start a discussion
– Bob Lerry
yesterday
sorry I need reputation to talk with you :))
– Bob Lerry
yesterday
I think the problem same line and substring causes the error. I tried several ways, it didn't happen java.lang.StringIndexOutOfBoundsException: String index out of range: -1
– Bob Lerry
yesterday
Updated the code. I am sure this will work, trust me :-) as I ran the code.
– supputuri
yesterday
Are you there, does it worked?
– supputuri
yesterday
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2f55281253%2fhow-to-verify-array-list-webelement-in-selenium-greater-and-lowest-value%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
DarkSky considered for test:

Python Script on darksky:

Just converted the python code to java
driver.get("https://darksky.net/forecast/40.7127,-74.0059/us12/en");
String currentTemp = driver.findElement(By.cssSelector(".summary.swap")).getText();
System.out.println("Current Temp:" + currentTemp);
List<WebElement> tempsInTimeLine = driver.findElements(By.cssSelector(".temps span:last-child"));
int temp = Integer.parseInt(currentTemp.substring(0, 2));
int highestInTimeLine = temp;
int lowestInTimeLine = temp;
for (WebElement tempInTime: tempsInTimeLine)
String sLIneTemp = tempInTime.getText();
int lineTemp = Integer.parseInt(sLIneTemp.substring(0, 2));
if (lineTemp > highestInTimeLine)
highestInTimeLine = lineTemp;
if (lineTemp < lowestInTimeLine )
lowestInTimeLine = lineTemp;
System.out.println("Highest Temp:" + Integer.toString(highestInTimeLine));
System.out.println("Lowest Temp:" + Integer.toString(lowestInTimeLine ));
it did not work. How can we start a discussion
– Bob Lerry
yesterday
sorry I need reputation to talk with you :))
– Bob Lerry
yesterday
I think the problem same line and substring causes the error. I tried several ways, it didn't happen java.lang.StringIndexOutOfBoundsException: String index out of range: -1
– Bob Lerry
yesterday
Updated the code. I am sure this will work, trust me :-) as I ran the code.
– supputuri
yesterday
Are you there, does it worked?
– supputuri
yesterday
add a comment |
DarkSky considered for test:

Python Script on darksky:

Just converted the python code to java
driver.get("https://darksky.net/forecast/40.7127,-74.0059/us12/en");
String currentTemp = driver.findElement(By.cssSelector(".summary.swap")).getText();
System.out.println("Current Temp:" + currentTemp);
List<WebElement> tempsInTimeLine = driver.findElements(By.cssSelector(".temps span:last-child"));
int temp = Integer.parseInt(currentTemp.substring(0, 2));
int highestInTimeLine = temp;
int lowestInTimeLine = temp;
for (WebElement tempInTime: tempsInTimeLine)
String sLIneTemp = tempInTime.getText();
int lineTemp = Integer.parseInt(sLIneTemp.substring(0, 2));
if (lineTemp > highestInTimeLine)
highestInTimeLine = lineTemp;
if (lineTemp < lowestInTimeLine )
lowestInTimeLine = lineTemp;
System.out.println("Highest Temp:" + Integer.toString(highestInTimeLine));
System.out.println("Lowest Temp:" + Integer.toString(lowestInTimeLine ));
it did not work. How can we start a discussion
– Bob Lerry
yesterday
sorry I need reputation to talk with you :))
– Bob Lerry
yesterday
I think the problem same line and substring causes the error. I tried several ways, it didn't happen java.lang.StringIndexOutOfBoundsException: String index out of range: -1
– Bob Lerry
yesterday
Updated the code. I am sure this will work, trust me :-) as I ran the code.
– supputuri
yesterday
Are you there, does it worked?
– supputuri
yesterday
add a comment |
DarkSky considered for test:

Python Script on darksky:

Just converted the python code to java
driver.get("https://darksky.net/forecast/40.7127,-74.0059/us12/en");
String currentTemp = driver.findElement(By.cssSelector(".summary.swap")).getText();
System.out.println("Current Temp:" + currentTemp);
List<WebElement> tempsInTimeLine = driver.findElements(By.cssSelector(".temps span:last-child"));
int temp = Integer.parseInt(currentTemp.substring(0, 2));
int highestInTimeLine = temp;
int lowestInTimeLine = temp;
for (WebElement tempInTime: tempsInTimeLine)
String sLIneTemp = tempInTime.getText();
int lineTemp = Integer.parseInt(sLIneTemp.substring(0, 2));
if (lineTemp > highestInTimeLine)
highestInTimeLine = lineTemp;
if (lineTemp < lowestInTimeLine )
lowestInTimeLine = lineTemp;
System.out.println("Highest Temp:" + Integer.toString(highestInTimeLine));
System.out.println("Lowest Temp:" + Integer.toString(lowestInTimeLine ));
DarkSky considered for test:

Python Script on darksky:

Just converted the python code to java
driver.get("https://darksky.net/forecast/40.7127,-74.0059/us12/en");
String currentTemp = driver.findElement(By.cssSelector(".summary.swap")).getText();
System.out.println("Current Temp:" + currentTemp);
List<WebElement> tempsInTimeLine = driver.findElements(By.cssSelector(".temps span:last-child"));
int temp = Integer.parseInt(currentTemp.substring(0, 2));
int highestInTimeLine = temp;
int lowestInTimeLine = temp;
for (WebElement tempInTime: tempsInTimeLine)
String sLIneTemp = tempInTime.getText();
int lineTemp = Integer.parseInt(sLIneTemp.substring(0, 2));
if (lineTemp > highestInTimeLine)
highestInTimeLine = lineTemp;
if (lineTemp < lowestInTimeLine )
lowestInTimeLine = lineTemp;
System.out.println("Highest Temp:" + Integer.toString(highestInTimeLine));
System.out.println("Lowest Temp:" + Integer.toString(lowestInTimeLine ));
edited yesterday
answered 2 days ago
supputurisupputuri
63038
63038
it did not work. How can we start a discussion
– Bob Lerry
yesterday
sorry I need reputation to talk with you :))
– Bob Lerry
yesterday
I think the problem same line and substring causes the error. I tried several ways, it didn't happen java.lang.StringIndexOutOfBoundsException: String index out of range: -1
– Bob Lerry
yesterday
Updated the code. I am sure this will work, trust me :-) as I ran the code.
– supputuri
yesterday
Are you there, does it worked?
– supputuri
yesterday
add a comment |
it did not work. How can we start a discussion
– Bob Lerry
yesterday
sorry I need reputation to talk with you :))
– Bob Lerry
yesterday
I think the problem same line and substring causes the error. I tried several ways, it didn't happen java.lang.StringIndexOutOfBoundsException: String index out of range: -1
– Bob Lerry
yesterday
Updated the code. I am sure this will work, trust me :-) as I ran the code.
– supputuri
yesterday
Are you there, does it worked?
– supputuri
yesterday
it did not work. How can we start a discussion
– Bob Lerry
yesterday
it did not work. How can we start a discussion
– Bob Lerry
yesterday
sorry I need reputation to talk with you :))
– Bob Lerry
yesterday
sorry I need reputation to talk with you :))
– Bob Lerry
yesterday
I think the problem same line and substring causes the error. I tried several ways, it didn't happen java.lang.StringIndexOutOfBoundsException: String index out of range: -1
– Bob Lerry
yesterday
I think the problem same line and substring causes the error. I tried several ways, it didn't happen java.lang.StringIndexOutOfBoundsException: String index out of range: -1
– Bob Lerry
yesterday
Updated the code. I am sure this will work, trust me :-) as I ran the code.
– supputuri
yesterday
Updated the code. I am sure this will work, trust me :-) as I ran the code.
– supputuri
yesterday
Are you there, does it worked?
– supputuri
yesterday
Are you there, does it worked?
– supputuri
yesterday
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f55281253%2fhow-to-verify-array-list-webelement-in-selenium-greater-and-lowest-value%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
Duplicate of stackoverflow.com/questions/55274122/…
– Fenio
2 days ago
1
Possible duplicate of verify current temp is not greater or less then temps from daily timeline
– Guy
2 days ago