How to detect 'select' option when multiple attributes have same id - python-2.7

<input id="Proc#fr#2-1-111" type="text" data-ctrl="JSCtrl" name="fr" style="display: none; background-color: rgb(224, 224, 224); width: 80px;" disabled=""/>
<select id="Proc#fr#2-1-111" data-ctrl="JSCtrl" name="fr" optionsdict="3,25 cm,4,29.97 cm,5,30 cm" style="border: 1px solid rgb(127, 157, 185); width: 80px;">
<select id="Proc#fr#2-1-111" data-ctrl="JSCtrl" name="fr" optionsdict="3,25 cm,4,29.97 cm,5,30 cm,6,50 cm,7,59.94 cm,8,60 cm" style="border: 1px solid rgb(127, 157, 185); display: none; width: 80px;" disabled="">
In the above code, id is same for input, select. I need to choose a value in select. Is it possible via selenium webdriver using python?

First of all, this HTML is not well formed. Duplicate IDs should be avoided. If you don't have access to modify the source code, talk to your manager please. Selenium developers should be able to change source whenever needed.
For the question about "how to find element by means id combined with style tag", here is how you can achieve it.
Use CSS Selector
driver.find_element_by_css_selector("select[id='Proc#fr#2-1-111']:not([style*='display: none'])")
Use XPath
driver.find_element_by_xpath(".//select[#id='Proc#fr#2-1-111' and not(contains(#style, 'display: none'))]")

Related

Remove QR Code after being Scanned

I've tried reading the documents or search for other similar question to it in stackoverflow or online, but it's either I'm not googling correctly.I'm not sure how to remove the QRCode after it has been scanned.
Is displaying it in a < p > tag wrong?
The QR code is generated from a type string not taken from a database.
Am I required to have a database and a script running with intervals that checks whether the QR code has been read,
Am I assuming wrongly?
//in my file.ts
createCode() {
this.createdCode = this.qrData;
}
My code for displaying the scanned QR
//in my file.html
<ion-card *ngIf="createdCode">
<ngx-qrcode [qrc-value]="createdCode"></ngx-qrcode>
<ion-card-content>
<p>Value: {{ createdCode}}</p>
</ion-card-content>
</ion-card>
If there are any relating questions that you have across please do refer me to it, as I'm not able to pin point over the few hours of looking trough.
Thank you in advance!
Never mind, I just had to add span class which handles closing it.
<span class =
"closebtn" onclick="this.parentElement.style.display='none';">×
</span>
<ion-card *ngIf="createdCode">
<ngx-qrcode [qrc-value]="createdCode"></ngx-qrcode>
<ion-card-content>
<p>Value: {{ createdCode}}</p>
</ion-card-content>
</ion-card>
and in file.scss add the following to display the closing button.
.closebtn {
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
color: black;
}

How to change distance between NavigationButton an ActionBar title in Nativescript?

I want to decrease the distance between NavigationButton and ActionBar title in a NativeScript app. How to do that for both iOS and Android?
You can Customize it by Using Labels inside the Action Items to place It anywhere on Action Bar - You can style it whatever way you want.
<ActionBar>
<ActionItem ios.position="popup" (tap)="capturePhoto($event)" android.position="popup" text="delete">
<Label class="font-awesome actionItemLabel" text="" color="white" style="font-size: 26; background-color: transparent; width: 40px; text-align: left;"></Label>
</ActionItem>
</ActionBar>

Font & Height Size of Region Display Selector

I am using 2 regions with 1 region display selector to create some tab functionality between regions. See the following as an example: http://apex.oracle.com/pls/apex/f?p=19914:30 I used the following to remove the 'Show All' button http://apexplained.wordpress.com/2012/07/16/hide-the-show-all-tab-in-a-region-selector/
Mine looks the same as the example above however it doesnt have the rounded corners on the region display selector.
I wondered how you can apply the rounded corners to the display selector, increase the font size and height of the region display selector?
I've tried style="" in the 'Region Attributes' of the Region display selector but no luck. When investigating my page in Firefox using Firebug the display selector is held in a DIV / in an UL list but i wouldnt know how to access those in the APEX builder.
The region display selector has rounded corners when using Chrome, but not in Internet Explorer.
Please could i have some help with my problem.
Oracle Version: Oracle version 10.2.0.4.0
Full APEX version: Application Express 4.1.1.00.23
Browser(s) and version(s) used: Internet Explorer 7 & 8
Theme: Simple Red
Template(s): The standard templates with the Simple Red theme.
Region/item type(s): 3 HTML pages each holding text box fields.
Thank you.
See example below of region display selector:
Example of region selector html from Simple Red theme
<div class="apex-rds-container">
<ul class="apex-rds" id="485041125812774413_RDS">
<li class="apex-rds-first">
<span>Show All</span>
</li>
<li class="apex-rds-selected">
<span>datepicker</span>
</li>
<li class="apex-rds-last">
<span>region 2</span>
</li>
</ul>
</div>
inspect style tab for
DIV
.apex-rds-container {
height: 40px;
margin: 0 0 9px;
}
UL
ul.apex-rds {
background: url("../images/bg-anchor-nc.gif") repeat-x scroll 0 0 transparent;
border: 1px solid #999999;
border-radius: 8px 8px 8px 8px;
box-shadow: 1px 2px 2px #AAAAAA;
float: left;
list-style-type: none;
margin: 0;
}
LI
ul.apex-rds li {
float: left;
list-style: none outside none;
}
A
ul.apex-rds li.apex-rds-first a {
border-left: 0 solid #000000;
}
ul.apex-rds li a {
border-left: 1px solid #FFFFFF;
border-right: 1px solid #999999;
display: block;
height: 16px;
padding: 1px 10px 0;
text-decoration: none;
}
a {
color: #660000;
}
SPAN
ul.apex-rds li span {
color: #000000;
font-size: 11px;
}
So, this shows that a background image is used for the UL. This image's dimensions are 1x18px according to firebug. Hovering over an item will set a different background image, as will a current region selection.
So, if you want a larger selection, use a larger image. Increase the div height. Set the correct styles for current/non-current items.
To increase font size, alter the css for the SPAN.
Borders are done with border-radius: 8px 8px 8px 8px; which don't work in IE.
All css can be found in the theme css file in your apex_images folder: /i/themes/theme1/css/theme_4_0.css
Go to line 1316,
/* -------------------- Region Display Selector -------------------- */
You can find everything you need there.
Don't mess in that file though. If you will, make a backup. Work clean and override properly within a css of your own!

placeholder in django forms using python

i am using django python, i apply placeholder for my forms fields in forms.py ,like
self.fields['email'].widget.attrs['class'] = 'form-text'
self.fields['country'].widget.attrs['class'] = 'form-dropdownfield'
self.fields['email'].widget.attrs['placeholder'] = 'Email*'
in .css file
.form-text
{
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
height: 30px;
width: 300px;
border-radius:8px;
border:none;
box-shadow:-1px 1px 1px 0 rgba(0, 0, 0, 0.1) inset;
border:1px solid #D2D2D2;
padding-left:10px;
}
Question 1:
Place holder working properly in all browser but not in IE,what can i do for IE problem?
Question 2:
Country field is dropdown list,how can apply placeholder for this one?
Placeholders work for INPUT form elements, but not for SELECT (dropdown) elements. This question has a number of answers that offer strategies for default values of dropdown elements.
Though I'm not sure, it's possible that many versions of IE don't support the placeholder attribute (and this post suggests that they're unsupported).
If placeholder is unsupported in a version of IE that you want to support, you could try a polyfill such as https://github.com/ginader/HTML5-placeholder-polyfill
No need to take any javscript or any method you can just do it with your html css
HTML
<select id="myAwesomeSelect">
<option selected="selected" class="s">Country Name</option>
<option value="1">Option #1</option>
<option value="2">Option #2</option>
</select>
Css
.s
{
color:white;
font-size:0px;
display:none;
}

What's the easiest way to add a quote box to mediawiki?

I installed mediawiki on my server as my personal knowledge base. Sometimes I copy some stuff from Web and paste to my wiki - such as tips & tricks from somebody's blog. How do I make the copied content appear in a box with border?
For example, the box at the end of this blog post looks pretty nice:
http://blog.dreamhost.com/2008/03/21/good-reminiscing-friday/
I could use the pre tag, but paragraphs in a pre tag won't wrap automatically.. Any ideas?
I made a template in my wiki called Template:quote, which contains the following content:
<div style="background-color: #ddf5eb; border-style: dotted;">
{{{1}}}
</div>
Then I can use the template in a page, e.g.,
{{quote|a little test}}
Works pretty well - Thanks!
<blockquote style="background-color: lightgrey; border: solid thin grey;">
Det er jeg som kjenner hemmeligheten din. Ikke et pip, gutten min.
</blockquote>
The blockquotes are better than divs because they "explain" that the text is actually a blockqoute, and not "just-some-text". Also a blockquote will most likely be properly indented, and actually look like a blockqoute.
To combine the two mostly valid answers, you should use a MediaWiki template that itself utilizes a blockquote.
The content of the template:
<blockquote style="color: lightgrey; border: solid thin gray;">
{{{1}}}
</blockquote>
Usage on your WIKI page (assuming you named the template "quote"):
{{ quote | The text you want to quote }}
Mediawiki supports the div tag. Combine the div tag with some styles:
<div style="background-color: cyan; border-style: dashed;">
A bunch of text that will wrap.
</div>
You can play around with whatever css attributes you want, but that should get you started.
I used the code from #steve k Changing light-grey to black and adding padding between the border and text. I found the light-grey nearly invisible and the text was directly adjacent to the border.
<blockquote style="
color: black;
border: solid thin gray;
padding-top: 10px;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 10px;
">
{{{1}}}
</blockquote>
You can use index.php?title=MediaWiki:Common.css page for this purpose and set a CSS style for the <blockquote/> element there:
blockquote {
background-color: #ddf5eb;
border-style: dotted;
}
In a similar fashion you can style <pre/> which is useful for code snippets etc. so that it wraps content:
pre {
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
For longer code snippets you may want to use <syntaxhighlight/> (or <source/>) element that comes with SyntaxHighlight extension. You can style it too.
Set a width in the pre tag, and it will wrap.
<pre width="80%">