How to check if element IsClickable ?

Class library usage, coding and language questions.
ngrishakin
Posts: 42
Joined: Fri Oct 04, 2013 9:47 pm

How to check if element IsClickable ?

Post by ngrishakin » Thu Dec 08, 2016 11:43 pm

In my dynamic CRM environment element is not clickable until entire page is loaded.
I was trying the following methods to check if page is loaded:
webDocument.WaitForDocumentLoaded(Global.WaitTime); // did not work
Validate.Exists(rxPath, wait1, "Load found", false) //did not quite work. Element is visible but not clickable

I want something similar to Selenium functionality like the following:

_driver = new InternetExplorerDriver(options);
_wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(20));
_wait.Until(ExpectedConditions.ElementToBeClickable(By.Id("navTabModuleButtonTextId")))

Is anything in Ranorex similar to "ElementToBeClickable" function?

Thanks a lot,
Nik

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to check if element IsClickable ?

Post by Support Team » Mon Dec 12, 2016 3:04 pm

Hello Nik,

Basically, the WaitForDocumentLoaded() function checks the readyState-Java Script property. Information about this property can be found at the following web page. Please note that in some cases the WaitForDocumentLoaded() function doesn’t work properly because it depends on the browser and on the implementation of the web page. For example, the method is not very reliable when automating dynamically loaded web pages.

Unfortunately, there is no similar function to "ElementToBeClickable". In such cases, it is recommended using the WaitFor Exists action to wait for a specific web element to be loaded. First, you will need to figure out any element that indicates that the web page was loaded successfully. After that, you could add the function to wait for this web element to exist.

I hope this information will help you.

Sincerely,
Johannes
.
Image