How to get the xpath for desktop application using winium.desktop driver? - ui-automation

We used inspect.exe to find the elements. We have tried to find the element with ID,NAME and class name for our desktop application but we found id = "", Name ="" and class name = "Text Box".
We can use class name,but we have two text boxes with the same class name.
So, What are the other possibilities to find element of Windows Desktop application and also how to find the xpath for desktop application using winium.desktop driver?
Any help can be appreciated. Thank you.

I Know this is little late, but I've used findelements in winium to locate all the elements with class name: Text Box and get the first one.
To click on First element with class name as Text box
driver.findelements(By.classname("Text Box")).get(0).click();

Related

Tag prefix Win CC

I am busy with a C script in Siemens WinCC.
I would like to open a faceplate on in which I can open other faceplates.
Howerver, I would like to use the Tagprefix from the first faceplate in the second. Does anybody have an idea how I can give the tag prefix through?
Thanks in advance!
Tom
As You know, the tag prefix is a property of the screen window. You need to provide that data to the script running in the context of the picture inside the picture window from the parent screen window.
One solution is by using a text field "tagname" in the "faceplate" and use that as a source of the tag-prefix name. The tag-prefix can be transferred by a simple vbs script that runs "on open".
Use VBS "Item.parent.TagPrefix" and then give the result to the text field.
Or just from a button in the picture "Item.parent.parent.TagPrefix" is also ok.
The same in C would use the functions "GetParentPictureWindow", and return a string(lpsz) containing the name of the picture window. This name can be used to read the property of the object with this name using "GetPropChar" using "Tagprefix" as the property.
//PerD

selenium cssSelctor with the use of class and text

How to create cssSelctor with the use of class and the text "Financial Modules", please check the screen attached.
I tried given but not working:
findElement(By.cssSelector("a[text='Financial Modules']")).click();
findElement(By.cssSelector("a:contains('Financial Modules')")).click();
findElement(By.cssSelector("a[class='ui-tabs-anchor'][text='Financial Modules']")).click();
findElement(By.cssSelector("a.ui-tabs-anchor[text='Financial Modules']".click();
findElement(By.cssSelector("li a.ui-tabs-anchor[text='Financial Modules']".click();
It works fine for:
linktext= findElement(By.linkText("Financial Modules")).click();
xpath=findElement(By.xpath("a[#class='ui-tabs-anchor'] [text()='Financial Modules']")).click();
You can't access innerHTML text using cssSelector this way, if you have such scenarios where you have to check text use xpath (or linkText if you are interacting with links) instead.

Custom content assist for default java editor in Eclipse

I'm currently trying to develop an Eclipse Plugin to support code replacement, like what the default content assist in Eclipse do. What I want to implement is something like "insert argument names automatically on method completion with visualized box around the argument" and I can "use the Tab key to navigate between the inserted names" and "while navigating, list of optional variables for current argument can be displayed and be chosen".
In short, it comes to two questions:
How to add the visualized box around the already existed variable or even Java keywords that need replacement? And at the meanwhile I can use Tab key to switch between these boxes.
How to display a list of candidates to select from when I trigger on the box?
By now I only figure out the extension point : org.eclipse.jdt.ui.javaCompletionProposalComputer may be useful, but I have no idea where to start at? Thanks in advance.
Oh, finally I've solved it myself...
For the 'box', it should be the LinkedModeModel, this class should work with LinkedPositionGroup and LinkedPosition to add mutiple boxes. And we should use LinkedModeUI to set it up.
For the content assistant, there's no need to use the extension point. There is a ProposalPosition class which extends LinkedPosition for you to add your proposals for the 'box' in its constructor. And we can simply use the CompletionProposal to construct a ICompletionProposal array as the argument of ProposalPosition's constructor.

How to have users enter a formatted date in wicket?

I am using wicket and eclipse and trying to create a text box to have users enter a date that will format itself (i.e. user pushes keys "20130607" and in the text box they will see "2013-06-07") I've tried
...
private DateTextField <String> EffectiveDateStart;
private DateTextField <String> EffectiveDateEnd;
...
EffectiveDateStart = new DateTextField<String>("EffectiveDateStart","yyyy.MM.dd");
EffectiveDateEnd = new DateTextField<String>("EffectiveDateEnd","yyyy.MM.dd");
...
myForm.add(EffectiveDateStart);
myForm.add(EffectiveDateEnd);
...
And when I try to compile it I get the error "type org.apache.wicket.datetime.markup.html.form.DateTextField does not take parameters" even though the Java docs show parameters on the constructor. I don't think the problem is in the form because it contains other textfields and labels and it works fine right now.
Also sorry if this is a stupid question, most other examples I found gloss over actually making the box and go into how to format it. I am very new to wicket and programming.
I would do this in JavaScript. There are a lot of JQuery plugins for this. First from Google Search:
http://digitalbush.com/projects/masked-input-plugin/#demo
Here there are more:
http://plugins.jquery.com/tag/mask/
Doing it on wickets side is possible but an overkill if you ask me.

Salesforce: Auto-complete for Lookup field

I have a custom object known as "Companies".I have created a lookup field in a Visual Force page which gives me the list of companies name from the custom object " Companies".I have written a code which makes this lookup field auto-complete like what you have seen in the image attached.(First pic)
The problem: I don't know how to make the lookup field (which takes the list of companies name from custom object" Companies" in "Opportunities" standard object) auto-complete as done in the visual force page. Basically want the field highlighted in yellow in the second picture to auto-complete or give relevant suggestion when I type the first few characters.
Any help on this matter would be appreciated. Thank you
Have you tied enabling Auto Complete for your custom object the search page?
Click Your Name | Setup | Customize | Search | Search Settings.
Check the Lookup Auto-completion check box for your object.
This will give you auto-complete options for recently used items.
http://help.salesforce.com/help/doc/en/search_lookupdialog.htm#auto_complete
You will not be able to embed this customization into a standard page layout like you're using for the Opportunity object in your second screenshot. If that auto-complete is a must-have, then you really only have two options:
Replace the entire Opportunity page layout with a custom VF page
Write a VF component with just the Company lookup field in it and embed it into your Opportunity page layout (this will have to be in its own section, which probably won't look as nice)
This is what you want - http://tapp.ly/autocomplete/
Autocomplete Lookups for Salesforce enables any Salesforce Lookup field to support autocomplete suggestions. Autocomplete Lookups helps your users enter lookup fields reducing data entry tasks and error rates.
Salesforce records suggested as you start typing
Search All fields (Standard Salesforce Lookups only let you search by the Name field)
Results can show any field (E.g. Case Subject rather than Case Number)