Re: [selenium-users] Digest for selenium-users@googlegroups.com - 3 updates in 1 topic

29 views
Skip to first unread message

Timothy Williams

unread,
Aug 30, 2022, 1:27:15 PM8/30/22
to seleniu...@googlegroups.com
Thank you for the replies. 
Adrian,
I am not sure what a throbber is so can’t say whether there is one or not. 
I have added a wait for the ‘Edit’ button to be clickable and have waited as long as 120 seconds with no result and wait fails. 

Kadambari,
Can you explain how to reload the element?
I don’t want to refresh the page because the application uses a lot of Ajax and the page I am on will disappear upon redisplay. 

Tim

On Tue, Aug 30, 2022 at 10:07 AM <seleniu...@googlegroups.com> wrote:
Timothy Williams <timm...@gmail.com>: Aug 29 08:40PM -0700

Hello,
Sorry for the late reply.
The problem is not accessing the element, the problem is that selenium sees
the element as still having the display:none and it tells me false when
using isDisplayed() method, but when I look at in browser dev tool I can
see the display:in-line is the current css for the element. It is like
selenium dom is not being updated to the current style of the element.
I have since noticed this with other elements on pages since moving to
Selenium 4 with Chrome versions 101 and greater..
 
Adrian <lord.s...@gmail.com>: Aug 29 09:42PM -0700

Hi,
It sounds like a timing issue.
 
The Save button has been clicked
And then you are testing to verify that the Edit button is displayed
And it is saying that the Edit button is not displayed and yet you can see
it is displayed.
 
After clicking the Save button is there a throbber that you need to wait
for?
If there is no throbber then an option would be to add a wait for the Edit
button to be clickable.
Something like:
WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("#editButton")));
 
 
Cheers,
Adrian.
kadambari saran <kadamba...@gmail.com>: Aug 30 11:25AM +0530

Try doing a reload of the element when the exception is thrown, using try
catch.
 
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to selenium-user...@googlegroups.com.
--
Thanks,
Timmer

Roger Cook

unread,
Aug 31, 2022, 2:24:49 PM8/31/22
to Selenium Users
Throbber: An animation that tries to indicate that the computer is doing something so that you don't click reload. 


And a reload of the current element would be something like finding it again because of a stale element reference exception. e. g. 

try
{
    element.DoSomething();
}
catch (StaleElementReferenceException)
{
    driver.FindElement(By.XPath("//xpath/to/element")).DoSomething();
}

roger

Reply all
Reply to author
Forward
0 new messages