I am currently doing a small project on web automation. Its for online betting at live roulette lounges,
my problem is this, since these are live-streamed events they have controls in place that show you things on screen and also control when and when not a bet can be placed on a number.
one of these controls is a 15 second clock that appears and disappears, while visible and counting down you can place bets, when it runs out it disappears and you have to wait for the dealer to spin the ball and for the result and clock to reappear before you can bet again.
I am looking to automate the whole process of bets being placed and certain things happening under certain conditions.
But is based around when that clock is visible because that is the only time you can bet, and since there is no definite time that the ball will have spun and landed, my only real option is to wait for the clock element
to be visible (the html
it appears and re-appears in the inspector on chrome ( i presume this is ajax
being used ) )
so i am looking to use a fluent wait with no timeout ( it will quite literally just wait for the element to appear because it will appear no matter what)
is there any way to make a "wait" in selenium ( with java ) so that there is no timeout but you can poll every second ??? for example i know sometimes 0 is used to say no time limit... can anyone help ?
i have an example of code here this is the only part i need help with, i know it has to be simple and no long outrageous code is required.
cheers guys
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.presenceOfElementLocated(By.id("my_element")));
I don's see how it's possible. This is how the
until
method is implemented:As you can see current time is compared with the
end_time
which is the time when the function is called plus the timeout. To solve your problem I would use some pretty big number of seconds.