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













0















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));









share|improve this question
























  • 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















0















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));









share|improve this question
























  • 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













0












0








0








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));









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












1 Answer
1






active

oldest

votes


















0














DarkSky considered for test:



enter image description here



Python Script on darksky:



enter image description here



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 ));





share|improve this answer

























  • 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










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
);



);













draft saved

draft discarded


















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









0














DarkSky considered for test:



enter image description here



Python Script on darksky:



enter image description here



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 ));





share|improve this answer

























  • 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















0














DarkSky considered for test:



enter image description here



Python Script on darksky:



enter image description here



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 ));





share|improve this answer

























  • 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













0












0








0







DarkSky considered for test:



enter image description here



Python Script on darksky:



enter image description here



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 ));





share|improve this answer















DarkSky considered for test:



enter image description here



Python Script on darksky:



enter image description here



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 ));






share|improve this answer














share|improve this answer



share|improve this answer








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

















  • 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



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해