Download Button Is Visible to User, but Not WebTestIt


#1

Good morning! I’m trying to use WebTestIt to connect to Microsoft Azure and download a file. With some fiddling, I got it to log in and navigate to the relevant page - great. However, it consistently times out with “Expected condition failed: waiting for visibility of element…” even with a ten minute timeout set on the page. Watching the process in Diagnostic Mode, I can see it getting to the correct page, with the download button clearly visible (and it works, if I click it manually). What else might be causing this problem?

I’ve tried referencing the button in question via CSS and also XPath; no change.

The one thing that’s a bit odd is that a couple seconds after navigating to the page (https://cloudpartner.azure.com/#insights/payout), the button in question (“CSV”) switches to a loading animation. That takes a few seconds, then it returns to normal. Just in case that’s a problem, I tried adding a 30-second delay after loading the page and before trying to click the button. No change to the error message.

Any ideas? I understand that downloads in general are often a problem. I have downloads set to automatic, so the Save File dialog does not pop up at all.

The server is an Amazon EDS machine, running Windows. I’m using WebTestIt 1.9.1, and Selenium. The browser is Chrome. Running the test manually works perfectly; it’s just a problem in WebTestIt.


#2

Hello @JonShaltz!
In your case, the problem might be an overlay covering the button, or the button is located in an iFrame, so maybe try to explore the HTML and see if there is something. Also, when the button “switches to a loading animation” thee DOM changes then the WebElement gets re-created so the WebDriver can not reference it. What you could try is to add a try/catch block so when the first attempt of clicking fails, the driver tries to find the button after the animation happens and interact with it again. Something like this:

        try {
        this.wait.until(ExpectedConditions.visibilityOfElementLocated(yourButtonElement)).click(); 
        } catch (Exception e) {
        yourButtonElement =this.wait.until(ExpectedConditions.visibilityOfElementLocated(yourButtonElement));        
        yourButtonElement.click();   
        }

It is a bit difficult to reproduce this issue, and it would be of great help if you could provide us with the exact page where this button is causing the trouble. The link that you provided is not accessible to us (of course because this is your personal Microsoft Azure account).
In case nothing works out for you, you could perhaps send us your project to [email protected] and we will take a look at it.
Kind regards!


#3

Thank you for your response, @smatijas. Replicating this is certainly an issue. I don’t use Azure much, but my understanding is that this is a standard report, and if so someone with an Azure account can replicate it - it’s the Payout Reconciliation Report, found under Insights | Payout. I certainly wouldn’t ask anyone to sign up for Azure purely for my benefit, of course.

Isn’t that try/catch accomplishing the same thing as including a delay after loading the page and before attempting to click the button? The idea is to give the page some time to finish its convolutions before clicking the button.

Unfortunately, there’s no change with the try/catch logic, or with both a 60-second delay and the try/catch. WebTestIt just isn’t identifying the button. I wish I could specify it by X/Y coords, or by the image name or image content.

I’ll ask Ranorex support if they have any ideas. Thank you for your idea!


#4

Ok @JonShaltz!
We will try to replicate this somehow on Azure, and see what is causing the issue :wink:
Thank you for your feedback!