Merhaba bu sorgunuzu çözer Umut
// this web-site shows counter ,its same like clicking on like button of face-book
// here instead of clicking we are refreshing the page or opening the same url again and again
driver.get("https://www.counter.gd/");
// finding the initial value of the counter is :
String initialCounter = driver.findElement(By.xpath("//*[@name='counter_id']")).getAttribute("value");
// printing the value of the counter, also converting the output type to int.
int countervalBefore = Integer.parseInt(initialCounter);
System.out.println("value of the counter before click/refresh is : " + countervalBefore);
// now refresh the page to increase the counter or click like button of the facebook to increase like counter
driver.navigate().refresh();
// now call the counter again
String afterCounter = driver.findElement(By.xpath("//*[@name='counter_id']")).getAttribute("value");
int countervalAfter = Integer.parseInt(afterCounter);
System.out.println("value of the counter after click/refresh is : " + countervalAfter);
// now verifying the previous counter value with current counter value
if(countervalAfter > countervalBefore){
System.out.println("Counter worked i.e incremented");
}else{
System.out.println("Counter not working");
}
altına gibi bunu yapabilir bu kullanarak Selen yapabilir.
Eğer mümkünse aynı örnek url sağlayabilir –
Onun bir mobil uygulama ama size facebook uygulaması veya benzeri sayımlar artar gibi herhangi bir uygulama gibi örnekler verebilirsiniz – Akash
Neden eski değeri bilmiyor musunuz ?! ?! Bunu neden sayfadan okuyamıyorsunuz? – SiKing