Unable to click or extract class string for Vuetify button
Posted: Fri Jun 22, 2018 11:45 am
We've just started developing a site using Vue.js and Vuetify. I'm finding that with both the Vuetify showcase and our web product that Ranorex will not click an object identified by a button tag. Does anyone have an idea why this is failing?
The showcase is here:
https://vuetifyjs.com/en/components/buttons
I've mocked up a test using this rather than our developed product as it should be easier for you to see and try our.
The repository object which fails is identified with this RanorexPath
Which is looking for this Success button on the page:
Trying to call .Click() on this repository object fails with this error:
If I define the repository object in this manner, .Click() succeeds:
So I do have a work around for clicking but it is a bit annoying that Ranorex doesn't think a button tag is an actual button.
The more difficult problem which has just cropped up this morning I can't see how to get around yet. This is for an example on our site, I'm trying to access the class string for a button object to determine whether it's in the active state.
The button:
The repository object:
The code to get the contents of the class attribute from the button tag. Note that the class attribute only includes the word active when the button is clicked and open, so that's what I'm checking for.
This fails with the same error:
Any suggestions for getting either of these to work on the button tag, especially the second example with extracting the class attribute, would be much appreciated.
The showcase is here:
https://vuetifyjs.com/en/components/buttons
I've mocked up a test using this rather than our developed product as it should be easier for you to see and try our.
The repository object which fails is identified with this RanorexPath
Code: Select all
.//button[@type='button' and @class='btn success']
Code: Select all
<button type="button" class="btn success" style="position: relative;">
<div class="btn__content">Success</div>
</button>
Code: Select all
Item 'VueInvestigationRepository.Vuetify.SuccessBtn' is no Button.
The element does not support the required capability 'button'.
Show/Hide Stacktrace
at Ranorex.Core.Repository.RepoItemInfo.FindInternal[T](Boolean findSingle, Boolean throwException, Duration effectiveTimeoutOverride) at Ranorex.Core.Repository.RepoItemInfo.<>c__DisplayClass75_0`1.<Find>b__0() at Ranorex.Core.Testing.Services.NoMaintenanceModeService.HandleElementNotFound[T](Func`1 action, RepoItemInfo entry) at Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException, Duration effectiveTimeoutOverride) at Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException, Duration waitTimeout) at Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException) at VueInvestigation.VueInvestigationRepositoryFolders.VuetifyAppFolder.get_SuccessBtn() in c:\Users\sarah.woodhouse\source\repos\Ranorex\VueInvestigation\VueInvestigation\VueInvestigationRepository.cs:line 985 at VueInvestigation.VueButton.Ranorex.Core.Testing.ITestModule.Run() in c:\Users\sarah.woodhouse\source\repos\Ranorex\VueInvestigation\VueInvestigation\VueButton.cs:line 59 at Ranorex.Core.Testing.TestModuleLeaf.RunInternal(DataContext parentDataContext, Int32 iteration, Int32 iterationCount, Boolean skipIteration)
Code: Select all
.//button[@type='button' and @class='btn success']/.//div[@class='btn__content']
The more difficult problem which has just cropped up this morning I can't see how to get around yet. This is for an example on our site, I'm trying to access the class string for a button object to determine whether it's in the active state.
The button:
Code: Select all
<div class="speed-dial speed-dial--right speed-dial--bottom speed-dial--fixed speed-dial--direction-top" open-on-hover="true" data-v-5cad50f3="">
<button type="button" class="btn btn--floating btn--raised theme--dark orange" data-ripple="true" hover="" style="position: relative;">
<div class="btn__content">
<i class="material-icons icon">add</i>
<i class="material-icons icon">close</i>
</div>
</button>
Code: Select all
.//div[@class~'speed-dial']/.//button[@type='button' and @class~'btn']
Code: Select all
public static bool FABOpen()
{
string fabStatus = repo.FormularyTree.Tree.FABStatus.GetAttributeValue<string>("class");
bool fabActive;
if (fabStatus.Contains("active")) {
fabActive = true;
} else {
fabActive = false;
}
return fabActive;
}
Code: Select all
Item 'DMDSearchRepository.FormularyTree.Tree.FABStatus' is no Button.
The element does not support the required capability 'button'.