I am currently using Selenium IDE to test a website with a simple drop down menu that has options like "Trial" and "Invoice" and "Portal". I do not want to select the options, but just to make sure they are available. How would I do this in Selenium IDE?
I have tried commands like verifyselectedvalue, verifyselectedoptions and verifytext, and verifyvalue, but they seem to give me a positive no matter what I enter in as value, even "sdhjgfhsg."
I have checked previous posts on this topic, there are many close, but not quite what I am looking for.
Much thanks,
Ilya
Additional hint:
To test if an option is selected
just use "verify selected label" in Selenium IDE
Example:
verify selected label | id=abc | 23:59
I did a test using a website has css menu drop down and I found the answer.
Record your script clicking on the css menu (each one) to get the element and after, change the command "click" to "verifyText". After that, set the field value (Selenium IDE) the text that you can verify (e.g.: Trial, Invoice and Portal).
I did this:
1st field: Command
2nd field: Target
3rd field: Value
> verifyText | css=li.has-sub > ul > li > a > span | Trial
> verifyText | //div[#id='cssmenu']/ul/li[2]/ul/li[2]/a/span | Invoice
> verifyText | css=li.last > a > span | Portal
Related
i find very useful the intellij shortcut 'Add selection for next occurence'.It basically adds to the current selection the next occurence of the same selected text,allowing so to modify a lot of same occurences at once and at your choosing(and not just all the occurences).
Now i've switched to eclipse to develop in php(and more),and i would like this shotcut back, but i cannot find it.I found the one that gets all the occurences(the name is 'Add all matches to multi selection'),but not the one who just gets the next one.
Can someone help?
In Eclipse, the command to add the next occurrence to multi-selection is called Multi selection down relative to anchor selection.
By default, there is no shortcut for this command, so you have to add a key binding yourself in the preferences General > Keys (hit Ctrl+Shift+L twice), e.g. Alt+K (which would be similar to Find Next Ctrl+K).
See also:
Eclipse 4.24 - New and Noteworthy - Action commands for multiple carets/selections
My Eclipse 2022-06 Java IDE Improvements video at 8:46
"Long live the Unix Pipes".
Since I am working with Eclipse IDE, I would like to perform search within search results. Is that possible? How can I do that?
Ex:
Search for references of User (class).
> Search for validation in this result.
> Finally, search for specific pattern.
This is possible in Eclipse, well as far as the version I am using which is Eclipse Juno 4.2.2; I've used this extensively for impact analysis.
For example:
Search using "File Search" with criteria "employee"
The results will appear in the Tab "Search", assuming you are in the tree view (by default), click the root folder
Again, use the "File Search" this time using the 2nd criteria, for example "default" and making sure to click the Selected resources radio button
Effectively, this searches the keyword "default" from the previous search results produced by searching "employee".
Is it really required?. If you are searching any key in the search results then why don't you use it as search key in previous search itself?.
Eclipse search supports regular expression so you can use multiple search words likes key1 or key2 or key1 and key2 etc to narrow the search results.
Refer this Eclipse File Search Dialog - Regular Expression for Group Unions and Negation
However
You can search in search results with the help of some plugins check here. Take a look at Insta search and glance(Suites for your need) plugin.
Search result can also be exported with the help of this plugin
You cannot. And I am 99% sure of this.
But, just for your info, you can do reference search by pressing Cntrl + G on class name, or method name.
I'm trying to automate selecting a dropdown in selenium ide, but I haven't been able to get it to work.
Basically, I record a click on the menu item, which reveals the drop down, but whenever I use the click command on one of the options, it closes the menu without ever selecting the new option. I've also tried the select command but I keep getting "specified element is not a select"
any ideas?
Selenium should be returning a single action when interacting with HTML select elements.
For example, if I had the following select element
<select name="numbers">
<option value="One">1</option>
<option value="Two">2</option>
<option value="Three">3</option>
</select>
And selected "2", selenium should return a single action.
| Command | Target | Value |
| select | name=numbers | label=Two |
If the IDE is not recording the event, you may be running into another issue such as the element being defined as hidden. Without additional details though, it's really hard to say.
Right click on the page and view source. The drop down options should be listed. Also the target name. You can then manually create the command. Don't do the first Item in the list. Pick like the third one first and test.
Once you have a single one working cut and paste it into notepad. Get the listing from the View Source and copy the line replacing the value. Copy and paste back in to Selenium on the Source tab.
I'm trying to select from a fancy select drop down menu, but for some reason i can't get the value to change. I've tried recording clicks, using the xpath with the click command, and now I'm trying to use the select command. None seem to work. Has anyone else encountered this/have any ideas about how to change the value of a fancy select?
If you have a select step defined, select (or selectAndWait) would be the Command, xpath=(your xpath) would be the Target, and the item you wish to select from the option list would be the Value. The Value can also be the index of the item in the list, where the topmost entry can be referenced by placing a index=0 as the Value:
select | xpath=[YourSelectElementXPATH] | ValueFromTheList
or
select | xpath=[YourSelectElementXPATH] | index=1
If you are able to include your step or the URL to the page in question, more specific assistance can be provided.
How to get the SLOC count for the Flex code in Eclipse?
Is there a plug-in similar to "Metrics" for finding information about the Flex porject?
This is the easiest way to count lines of code of any particular language and does not require a plugin.
Steps:
Click on the root folder of your project
Right-click and select Search (or Cntl+H)
In the box "Containing Text" type \n and make sure to select the "Regular Expression" checkbox
In the "File name patterns" input, type the file extensions of the files you want to include in your count, or click on "Choose" if you are feeling lazy.
Click "Search"
BAM! Instant line count for your entire project!
These instructions may differ slightly depending on your version of Eclipse, but you should be able to figure it out.
Good luck!
From this question:
http://metrics.sourceforge.net can do lines. I'm not sure about words
however.