I am having issues with Chrome throwing element stale, element not click able other element would receive click. My question more so has to do with pageFactory framework.
Given that chromedriver has these issues I would need to rewrite the selectors with offsets and other functionality to make it able to be click able correctly.
Should I make new xxxxPage.class's specifically for chrome? Or should I just incorporate all the chrome fixes into the current xxxxPage class, knowing that it will most likely work in firefox?
Or I can make a copy of the "SignIn" function for example with chrome fixes.
Basically what is the best way of keeping your final test code clean, with these changes?
Thanks
From my perspective the page object should describe the page elements and not should be depends to the concrete driver implementation. I suggest to implement the helper common class that contains some common methods and then the specific classes that contains the specific implementation per browser. Then in your page object you will call the one common function which will call the required to the driver class/method. In other words you will encapsulate the specific driver behaviour in the specific classes and the common class will decide what specific class will called.
Related
One of the issues I'm currently experiencing is that I can't seem to change the text of a Label which is implemented in a dynamically loaded AnchorPane. I assume this might be related to the controller and how JavaFX/TornadoFX works, but I can't seem to find what I'm doing wrong.
The issue itself occurs in this class, and happens in the showSystemDetails() method. What I would expect to happen is that upon pressing the "System Details" button in the sidebar, the labels would update to the required value, but this isn't happening for some reason.
Please feel free to point me to what I'm doing wrong, or provide any constructive criticism. The project is still in full development so a lot of things are still messy/broken.
The reason this isn't working is that you're manually loading a new version of the FMXL file every time you select something in your menu. The FXML file originally loaded by SystemDetailsViewProxy is updated correctly, but that's not the one you're showing on screen anymore.
To see the updated View, make sure you put the root node of the SystemDetailsViewProxy instance back.
You could for example change your DrawerMenuButton enum to contain references to SystemDetailsViewProxy::class instead of those two strings, and use add(viewClass) to add the correct root node to your view when clicking the menu buttons.
Furthermore, you should be using ViewModels and binding instead of manually updating the text property of the labels. You're doing an awful lot of manual/error prone work that the framework can help you with for free.
Your application is not using best practices in several important areas, and you're rolling your own solutions for stuff that the framework already does very well :)
Views are singletons when managed by the framework, but you instantiate them yourself instead of using inject/find. The result is that important life cycle methods are not being called.
I would also suggest looking into type safe builders instead of FXML.
Hope this helps :)
CSS Cascade and Inheritance spec defines the so called 'Override origin' for style sheets that links to DocumentCSS interface (from the DOM Level 2 spec from the year 2000). This seems to be the only mention of this interface on the W3C site (except of short conversation in the www-dom mailing list from 2008). The DOM Level 2 spec has the following text about it:
The expectation is that an instance of the DocumentCSS interface can be obtained by using binding-specific casting methods on an instance of the Document interface.
Is this mechanism implemented anywhere? Is it possible to play with these 'override styles' and to see the DocumentCSS interface in action?
Sorta exists in WebKit (via KHTML) but not really, because the implementation just returns null.
And that just-return-null implementation ended up in Chrome too but was subsequently removed.
Also, as a comment above notes, a Firefox feature request has been open for it for 10+ years.
As far as Edge, there’s no indication it’s been implemented there yet either.
So it seems the answer is, it’s never actually been supported anywhere. Maybe somewhere in the CSS Houdini plans there’s something that will provide the same functionality?
I am currently working for a mobile UI automation testing. Our application is hybrid mobile app based on Cordova. So I am planning to use appium to run some automation tests.
One thing I need to figure out is how to find all the element in a page.
I was previously planed to use xpath to find all elements, since we can detect xpath through appium inspector. However, my colleague does not agree with me, since he wants to use css selectors as the key to find all element in the mobile app. But for appium, it does not show css selector in the inspector.
So, i am just curious which approach should be better?
Thanks
Below is my breakdown of Locators and how/why I like to use each for iOS Automation. All of this is experiential based on my work with Native iOS applications.
Giant disclaimer:
I don't know anything about Cordova. I hear there are issues that exist with UIAutomation if there are class names that aren't native. If that is the case, I suggest sticking to accessibility id and class name locator strategy.
Locators for iOS Automation
CSS Selectors
CSS Selectors do not exist in Appium.
Class Name
The closest you'd get to CSS Selectors is the Class Name selector. I don't really use them because UIAutomation gives me what I need and allows me to check for the name/text of the element in the locator strategy.
XPath
You don't want to use XPath because it's slow and flakey on iOS. (It can sometimes return an entirely incorrect element). It can sometimes cause Instruments to fail for no reason. Highly suggest staying away from XPath.
Accessibility ID
You should use this when UIAutomation fails to find the element. It's quicker than XPath but is useful when UIAutomation doesn't let you at an element (.actionSheets() is broken I think. I use this for when the action sheet is up and I need to .click() a button)
UIAutomation
You should use Apple's UIAutomation, 2 framework as it is the quickest, native solution to iOS.
The UIAutomation framework allows you to use classes and hierarchy to specify which element you want. When you use Appium, use the find_elements_by_ios_uiautomation function on your webdriver.
Example Usage here
But the example usage doesn't tell you how powerful UIAutomation really is. A common problem I ran into is trying to find all cells of a tableview when there was more than one tableview on the screen.
Find all UIACells for the UIATableview "Cart"
**Sample View Hierarchy**
<application>
<window>
<table name="Items">
<cell name="Foo, not in cart"></cell>
</table>
<table name="Cart">
<cell name="Bar. IM IN YOUR CART"></cell>
</table>
</window>
</application>
OK now to find those cells in an array:
value = '.tableviews()["Cart"].cells()'
cells = driver.find_elements_by_ios_uiautomation(value)
Extra Reading: Guide that goes over predicates and why they're awesome
Limitations for UIAutomation
If your element doesn't have a visible name. (Developers like to put invisible buttons behind "Hint Overlays" and the like.)
Suggested Solution: add an accessibility id, use the accessibility id locator.
Testing locator strategies
There's a nice place in the Inspector (provided in the Appium.app GUI) which lets you try whatever locator strategy and value you want. You should use it. It helps so, so much.
due to lack of documentation about this feature i can't find a way to do this. I am trying to use autoLoad with merge mode. I have a TabPanel in which each tab is supposed to open autoloading another page using merge mode.
i am aware that plain HTML does render, but pages including Ext.net components fail to render. In my child page i have a resource manager registered with RenderScripts set to 'None' Ext.Net examples page shows a merge mode example in that way.
Right now i get a 'Ext.net.Store is not a constructor' in the child page.
Is there any special parameter which needs to be sent in the loadConfig when doing the autoload? or are there any special elements besides resource manager needed on the child page?
Using <AutoLoad Mode="Merge" /> is very tricky. In general I'd say it should be avoided, with preference given to using 'XRender' functionality or <AutoLoad Mode="IFrame" />.
It's tough to say exactly what's going wrong in your code. Posting a simplified sample demonstrating how you have things configured and demonstrating how to reproduce the problem would be very helpful.
I'm developing an infrastructure for a major project currently based on caliburn 1.
It works fine but it seems like the future is in caliburn micro, am I right?
If I do, how do I implement filters? How do I specify view to a view viewnodel (non conventional)?
And whats the best place to put my splash logic (not root model)
I recommend moving to Caliburn.Micro as it's simpler and easier to extend. It is where any future innovations will be made and it has a larger more active community. As far as filters go, you can actually build them and plug them in. See here Marco's post You can add non-conventional view specification as well. You just plug into the view locator and teach it how to find views. For example, if you want to use an attribute, you can just have the locator look for that attribute first, use it if found, otherwise fall back to the default behavior. Regarding splash logic, you can do that by customizing the Bootstrapper.