How to use dataprovider to pass data in website? - selenium

website for automation.
https://ultimateqa.com/complicated-page
pass all data on form by DataProvider only.
use css selectors instead of xpath.
create a script using different Collections in it. Use ArrayList, LinkList and HashMap, for passing and fetching back the data.

Related

DOM manipulation through VanillaJS in VueJS Framework

I've started using VueJS a month ago. I've watched many tutorials to learn the language, but generally I never see developers using the DOM methods such as getElementById or getElementByClassName to make manipulations onto an element that is inside of a component or inside a view.
I'd like to give an example to make my statement more clear.
For example lets suppose that we have a nested component called UsernameInput that is an input[type="text"].
Instead of having to pass the value through the #input directive, we could get the value from the parent using the document.getElementById(/* Id Of The Input /*).value . I know that Vue uses the Virtual DOM for the rendering to make it faster. But does using VanillaJS affect it in any sort of way? And why is it so rarely used in front-end frameworks

Is it possible to capture ItemId property in extjs using selenium?

I have to test an Extjs application. But the id is dynamic so there is no way to capture it. But developers have been adding another property as itemId to elements. Is there a method to capture that itemId using selenium?
You can execute JavaScript code on the page using Selenium to get the dynamic ID.
In this code you can use Ext.ComponentQuery for getting exactly the ExtJS component you want. Next using function .getId() you can get the dynamic ID.
driver.execute_script("Ext.ComponentQuery.query('#myPanel').getId()")
You can read more in my other A to the similar problem
https://stackoverflow.com/a/41718879/1768843

Compile string with custom elements

I have an Aurelia application in which I'm trying to build a CMS component. This component will load data from the server and this data mainly contains slug, title and content fields.
I also have several global components defined in my application, and I want to be able to use those components in the server so when I pull that data my CMS component is able to transform/compile those custom elements.
An example would be a tab component. I have the tab component with this structure defined:
<tab-panel>
<tab title="First"></tab>
<tab title="Second"></tab>
</tab-panel>
The CMS component will contain a content property which I use to pass a string like this: '<tab-panel><tab title="First"></tab><tab title="Second"></tab></tab-panel>'
The component needs to compile that string and render it in its view. I've checked the enhance API, but it doesn't worked, at least for me. Any other suggestion to dynamically compile/render custom elements??
Thanks a lot in advance.
I've found the solution. I've used a compose element and InlineViewStrategy and it worked well, the components are shows and binding works as expected.
If your custom elements are registered globally using globalResources you can actually using the TemplatingEngine to dynamically insert content into the DOM and then compile it after-the-fact. This blog post goes into detail in how you can do it.
However, I would use this as a last resort. As is mostly always the case, there are much better ways to do something in Aurelia. Using the <compose> element is a great way to dynamically render content in your Aurelia applications and should always be the first port of call.

Create a Reusable method to Verify list elements by Selenium WebDriver

I am new to this site and don't know how things show up here. I was reading the post from below where String array is being used to ListwebElements.
Verify list elements by Selenium WebDriver
String[] expected = {"GRAM", "OUNCE", "POUND", "MILLIMETER", "TSP", "TBSP", "FLUID_OUNCE"};
I am trying to do something similar using String Array trying to get different buttons on a UI page. I want to make this method reusable by changing the "expected" list per test. Does anyone know how you would make this method Reusable?
In my case, "expected" list is different each time depending on a page.
I would suggest to use the custom annotation for reusing purpose. Please see the example here.
If you are using JUnit you can also use parameterized test

Is it possible to load Aurelia templates in javascript and convert to a string

Is it possible to load an aurelia template using javascript and populate it with data manually? I'm creating a leaflet map popup which takes a "content" html string. I'd like to load in a template, populate it with data, and then render it to a string which I can pass to the popup's setContent method.
You could try using Aurelia's Dynamic Template Compilation https://github.com/aurelia/framework/issues/102 to solve for this.