have a small Problem to choose a value ID in special Dropdown Box with iMacros. The Dropdown is on mrssporty.de/. It's the first Box in the main Fomular for Selecting the Club.
I have the the Value Ids like this:
<select id="clubUid" name="form66[clubUid]" class="form-control select select2 select2init">
<option value="">PLZ oder Ort eingeben *</option>
<option value="1139" >Aalen (73430, Bahnhofstraße 8)</option>
<option value="26" >Ahrensburg (22926, Grosse Strasse 2)</option>
<option value="27" >Aichach (86551, Augsburgerstr. 17)</option>
<option value="1128" >Altötting (84503, Marienstr.3)</option>
<option value="29" >Alzey (55232, Berliner Strasse 3)</option>
and want to choose one value above with iMacros like
TAG POS=1 TYPE=SELECT FORM=* ATTR=ID:select2-drop CONTENT=$1139
Use these settings in Recording Options.
http://i.imgur.com/pLeKEHa.png
And record selection of drop down.
If you have multiple dropdowns and u want to do them all you can record 2 or 3. Then you can see which number inside () is changing. Then place !LOOP inside that number.
(!LOOP)
With little work u will see what I mean.
actually i solved it like that
EVENT TYPE=MOUSEDOWN SELECTOR="#select2-chosen-3" BUTTON=0
CLICK X=646 Y=267
wait seconds=1
EVENTS TYPE=KEYPRESS SELECTOR="#s2id_autogen3_search" CHARS="12587"
EVENTS TYPE=KEYPRESS SELECTOR="#s2id_autogen3_search" KEYS="[13,13]"
But its not really smart. Anyone a better Idea?
Related
I am trying to add icon in my Apex 21.2 cards region using SQL query. I used the following sql query:
select 1 card_primary_key,
'Users' card_title,
'Product Users' card_subtitle,
'fa-users-alt' card_icon
from dual
Then under attributes, under Icon and Badge, I set Icon Source=Icon class column and Icon Column = CARD_ICON, and Icon Position= Start
The title and subtitle are the only things showing, no icon shows up, there is just an empty space to the left of text.
I inspected the page looked at the html generated
<span class="a-CardView-icon u-color fa-users-alt" aria-hidden="true" title=""></span>
Could it be because area-hidden is set to true? If so, how do I change it? I did try changing fa-users-alt to fa fa-users-alt etc. but nothing worked
Can't figure out what is happening here. Would really appreciate some help. I am using Template Cards Container and Style A
I did a quick try on apex.oracle.com (which has been upgraded to 22.1 already, but that shouldn't make a difference) and it worked just fine.
Used query
select EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO,
'fa fa-users-alt' as icon
from EMP
Settings are same as yours and the icon shows up just fine. The html element is same as yours too - with aria-hidden="true":
<span class="a-CardView-icon u-color fa fa-users-alt" aria-hidden="true" title=""></span>
I want to create a regex which gives result for the selected field in a drop down list for a particular id.
For example: if I pass id="countries" the result should be India (since India is selected) or id="Gender" the result should be Male.
<select id='countries'>
<optionvalue='0'>All Categories</option>
<option value='1'>USA</option>
<option value='2'>China</option>
<option selected='selected' value='3'>India</option>
<option value='4'>Japan</option>
</select>
<select id='Gender'>
<option value='0'>All Categories</option>
<option selected='selected' value='1'>Male</option>
<option value='2'>Female</option>
</select>
Note: Consider above HTML as a plane text.
Extracting HTML data using regex is a very very very bad idea. It's complicated and inefficient. You are better off using a HTML parser (such as JSoup or BeautifulSoup) for HTML, a JSON library for parsing JSON, etc.
That being said, here is a regex that should work as long as the id is quoted. If your id is in a variable called id, then your regex will be
regex = "<select[^>]*? id=['\"]" + id
+ "['\"].*?<option[^>]*? selected[^>]*?>([^<]*)";
Note that for this to work, the select with that id must actually have a selected option.
I created a gmail account and then when to Google+. On landing page, it first asked me to complete profile like Gender / Month / Date
I observed that there is no Select Tag. It is a dynamic div and it uses active-
<div class="mxa MC">
<div aria-activedescendant=":1x" aria-haspopup="true" tabindex="0" aria-expanded="false" style="-moz-user-select: none;" role="listbox" class="d-k-l d-y-r-c b-Qb hl">
<div aria-posinset="0" aria-setsize="4" role="option" id=":1x" class="d-k-l d-y-r-c-ha">Select</div>
<div aria-hidden="true" class="d-k-l d-y-r-c-Qa"> </div>
</div>
</div>
Am not able to understand how to click Male / Female once the dropdown list opens. The html doesn't change only the class expands further and aria-activedescendant value changes to :1q in case Male, :1r in case mouse hovers or Female
And on choosing this attribute value is set and next line "Select" text is changed to Male or Female, whichever chosen.
So how do select Gender or list items in such a situation
Flow was:
I created new Google Play Account through BlueStack, where it didn't ask for Gender / Month / Date
Then I opened browser on Desktop and opened this link
https://plus.google.com/up/accounts/upgrade/?continue=https://plus.google.com/
And there you get the option of Gender / Month / Date
Consider the following text that might be part of an HTTP response from jMeter:
<menu id="Alpha" name="alpha">
<option value="a">A</option>
<option value="b">B</option>
<option value="c" selected="selected">C</option>
</menu>
<menu id="Bravo" name="bravo">
<option value="d">D</option>
<option value="e">E</option>
</menu>
I'm trying to extract the ID of each menu, as well as the selected option's value if there is an option selected. If there is no option selected, then by default, the first option's value should be matched. For example, in this example, I want the following to be matched:
"Alpha" "c"
"Bravo" "d"
So far, I have written the following:
<select id="Form:parameterList:([^"]+?)".*?>.*?(?:<option value="([^"]*?)".*?(?:selected="selected")?>)?.*?</select>
The problem with this is that only the first option's value is ever matched, and the selected option is never matched. That is, I want to prioritize matching the optional pattern.
Thanks,
Victor
Consider how maintainable your script will be using that complex regex.
You can achieve the result you desire using xpath extractors, conditional/loop controllers and or post-processors...
First get a list of all ids:
//menu/#id
You can get a list of ids containing an option with attribute selected = 'selected' with something similar to:
//menu/#id[/option[#selected='selected']]
Iterate through the first list (in a beanshell processor or loop controller, for instance). Where an id appears in the second list, extract the selected value with:
//menu[#id='xxxx']/option[#selected='selected']/#value /*substitue xxxx with appropriate id*/
Where the id does not have a 'selected' value, extract the default value:
//menu/[#id='xxxx']/option[1]/#value /*substitue xxxx with appropriate id*/
(sorry if my xpath aren't completely accurate, I have written this from memory alone, but hopefully the breadcrumbs are there to follow)
I am looking to automate selecting an item from a list where the generated HTML looks like:
<select name="uid_1"">
<option value="0">All</option>
<option value="1">Option A</option>
<option value="2">Option B</option>
<option value="3">Option C</option>
</select>
I can use the iMacros script line to select Option A, which has a value of 1:
TAG POS=1 TYPE=SELECT FORM=NAME:myForm ATTR=NAME:uid_1 CONTENT=%1
But I need to select by the display text "Option A" as this will be more stable than the options value.
Is this possible with iMacros?
Note that I am using the iMacros plug in for Firefox.
Better answer: Use a $ instead of a %.
TAG POS=1 TYPE=SELECT FORM=NAME:myForm ATTR=NAME:uid_1 CONTENT=$Option<SP>A
Note: The <SP> command indicates a space and is case sensitive.