xPath Namemapping for several dropdowns - excel

I have a button that is dynamic in several webscreens using TestComplete.
I have a buttonKeep object that is successfully implemented in the first screen it goes through the first screen and selects a Word and Excel document copies data up and then I paste it to the website
//div[(contains(#style,'display: block'))]//button[#id='Keep']
OR //div[not(contains(#style,"display:none'))]//button[contains(#class, 'fr-keep-word')]
OR //button[contains(#class, 'fr-keep-word')]
OR //div[2]/div/div/button[2]
OR //div[contains(#style,'display: block')]
Now I will select a screen that will move me on to a series of dropdowns where I will do the same thing in one of the drop downs. The system wants to add a different buttonKeep object everytime I run the test rather than recognized that the item had been mapped correctly earlier. Or even when I selected the first time I run the test.
Any suggestions would be very helpful.

I imagine this issue is due to a dynamic element in the page object. With the page objects being different, that cause the same object to be mapped again.
I would recommend investigating the page objects, and if they are the same page, but with a dynamic section, add wildcard values to account for the dynamic nodes.
To make mapping settings independent of dynamic changes in web page URLs, you can use the asterisk () wildcard in place of the values -- http://www.example.com/index.asp?act=12312&sid=, or in place of the entire query string -- http://www.example.com/index.asp.

Related

JHipster ComboBox lazyloading

I'm starter to use JHipster. One of my entity A has more than 3000 data. So I used infinite-scroll as pagination. But as relation to another Entry B, it will be generated as a comboBox in the dialog. I got only 20 data in the comboBox. There is no infinit-scroll or search and loading to get more data.
Can someone give any advice to fix the problem?
The infinite scroll uses pages (which is mapped to pageablea in spring). Thus, your service call that fetches the data for the box only fetches the first page. And the default page size is 20. So, you need to increase the page size to get more results.
You can either overwrite the "size" variable or the global constant called "itemsPerPage" which is located in pagination.constants.js
Am I right that it is a one-to-many relationshiop and you want to choose one of 3000 possible A for an entity B?
If so, you don't want to load all 3000 possible As into the dropdown. Therefore, I would replace the dropdown with another input, e.g. the typeahead from angular-ui (https://angular-ui.github.io/bootstrap/#/typeahead), so you can fetch a filtered subset of your entities.
Another way, I also used before, would be a list with a pagination for A that opens in a modal and returns the selected entity that could be passed to b.
Or, if you really want to fetch all: I would add a new endpoint without the pageable, add a new method to the angular-resource-service and call this instead of the paged version.

Change the site look based on user's list item property

We have a list containing the ADUsername and Boolean field (Yes/No) columns. Based on the logged in user we are fetching this list item and corresponding value for yes/no field.
Now we want to change the look of the SharePoint site based on this value.
Yes=Blue suitebar and top bar.
No=Green suitebar and top bar.
Possible solutions we have envisioned:
Composed looks (we have worked on this but not sure if they can be changed on run time)
Master page (creating master page with hardcoded blue/green color, but not sure if it is possible to call master page at runtime)
I believe both above methods will fail as there will be multiple users accessing the site at same time and changing the master page/composed look at run time is not feasible.
The 3rd method we were thinking of is to use Javascript on the Master Page using client object model to detect the list item (yes/no) value and change the CSS colors/file dynamically.
Let me know your views on this approach or other possible solution. Thanks.

UIA - AutomationElement doesn't return correct name when list view changes

I'm trying to read the contents of a "list view" using automation. The first time I navigate to it, I'm able to go from item to item, getting the correct text for each list item. However, when I display a different screen (which is apparently reusing this display object), the text on the screen is different, but automation gets the same text as the first set. From then on I can only get the text for the first view I looked at. It's like the text is being cached and I'm only able to look at the cached view. UISpy, however, seems to grab the right values every time, and if I use it while my automation is paused, I end up getting the right values.
In my automation, I use Find to grab the header, and walk the tree to the List View and get the text for each element. I thought if you used the Current property, you got the live data. Apparently I was mistaken. How do I either refresh the tree or get the REAL data?
Yes, the Current property on a certain AutomationElement will return its current, 'live', value. UIA will not cache anything automatically, you'll have to declare it yourself and explicitly access the Cached properties.
What's probably happening is that the new tree items you're seeing after selecting a different screen, are actually re-created (and that actually makes sense, UI-wise), not just updated. You could easily determine if this is the problem by selecting the first screen and writing down the tree items' RuntimeId property (you can see it in UI Spy). Then, select the second screen and check if the RuntimeId has changed. If it has, then it's just not the same object instance.
If this is the case, all you need to do is get the items again. It'll be easier to do this using AutomationElement.FindAll with a ClassName property condition.

Get listitems from Current Site

I am trying to create a Page Layout, that should have a lookup field. Lookup field should always get populated with a list's items.
This list will exist in all subsites, so whereever I create this page, list should get populated with listitems from current site.
I tried using site column lookup field, but it always point to list under top site and not the current site.
Any suggestion on how to make it work or better alternative? Thanks!
Let me know if I can provide more info.
The most straightforward solution I can think of is using a cross site lookup column and creating a seperate fields for each subsite. However, you will need to create and use different Page Layouts for each subsite.
You can use http://sp2010filteredlookup.codeplex.com/ for cross site lookups.
Solution 1 - Use http://sp2010filteredlookup.codeplex.com/
Use filtered lookup solution. So let's say you have your custom Page Layout and custom Page Content Type.
Every time you create new subsite, you should remember go to Pages list settings and edit Page Content Type by adding cross site lookup (with the same field "internal name").
So you still have one Page Layout (and one Content Type). But for each Pages library instance, Content Type contains diff fields (but with the same Internal Name). It will allow you run CAML queries and other things needed without any problems.
Solution 2 - develop custom sharepoint field type.
In edit mode, control will render "dropdown list" and populate data from list instance that is on current subsite. In the field settings you can have relative list url.
Solution 3 - hidden text field / js snippet solution
Page Content Type can contain hidden text field (it can contains selected field value in json format for example). Develop js snippet that will handle all the logic (rendering in edit/view mode, saving etc) and put it on Page Layout (aspx).
I would suggest to use solution #1 or #2.

SharePoint custom field control intermittently reverts back to text field

This is maybe a long shot, but I have a custom field control that renders a colorpicker field for a custom SharePoint list. The field control inherits from the BaseFieldControl.
Most of the time everything works fine, but every now and then the control will revert back to a normal text field within the list. (Possible reverting to the Parent BaseField) This happens on the edit item page.
Something else we noticed is that every time this happens the labels for the fields will display the resouce location instead of the resource value. For example it will display
$Resources:CT_Banner_Name;
Instead of the actual value in the resource.resx file.
Any Ideas?
Usually when I see the $Resources: it's a clear indicator that a feature is missing on one of the load balanced servers. Maybe your custom control references an absolute url or server directly which may cause certain requests to fail?

Resources