Verification of currency symbols in webpage using selenium webdriver - xpath

For ecommerce web applications, I need to verify whether the correct currency symbol is displayed or not, depending on the country.
In the below site,
http://www.moltonbrown.co.uk/store/index.jsp
am checking for the currency symbol in the basket summary.
In Selenium IDE, when I do verifyText for xpath //div/span[contains(text(),'£18.00')], it runs well. But, when I use the same xpath in selenium webdriver automation code and try to verify the element, it displays:
//div/span[contains(text(),'�18.00')]
Element not found
false
***************
//div/span[contains(text(),'�18.00')]
*************
***************not present***************
I saw this get currency symbol using php . But couldnt understand what should be done to overcome this.
Thanks in advance,
Suchitra

The fact that your currency symbol is turned into a � indicates there is a character set issue that is causing your problem. From the web-driver documentation, there is "limited" support of unicode by using UTF-8. Limited probably means "buggy".
In any case, you should verify that that the file that runs this test is saved using UTF-8, and that the bytes for your currency symbol are correct for UTF-8. If this file is in some other character set, save it as UTF-8 and try again.
Here is somebody that had a similar problem with the ä character and python drivers. Sending unicode with Selenium Webdriver on python They were able to solve the problem by changing the declared character set of their python file.

Related

QT Application UTF8-strings in translation get displayed erroneous

We are using QT 5.5 successfully throughout our VC++ projects in VS2015.
Now, i am adding i18n thereto, using QTs Linguist tools to create my strings 2b translated and the resulting .qm files. I load the files through QTranslator object, the translation itself seems to work, but they get displayed wrongly.
As german is my mother tongue, I have to type several umlauts, beside any other special unicode-characters I definitely want to support.
As en example, I use linguist to translate over to über, and the resulting text in my application reads über. What I can surely recognize as an encoding mismatch.
I already had a look on the i18n example, which displays correctly for all of the provided languages, so I right now do not know what's wrong after I checked all file encodings.
Anyone any ideas? Or even has the same problems? Or had them but solved? Any suggestions were greatly appreciated!
This seems to be a Windows-specific problem.
Instead of using QString.toStdString() (what breaks the correct string), better use QString.toLatin1() at least for the languages to support yet.

Cloud9 IDE - equal symbol in filename

For my CMS, I need to create file with an equal symbol in the filename.
For the moment, it is not possible through the IDE, how can I request this feature?
Tks
Freed
Cloud9 IDE does not have a specific place to make feature requests so you need to email their support for that.

Building a Character Generator

I'm looking to build a character generator for 5th edition dungeons and dragons, just as a side project. However what i don't know is which language to use. so far Ive narrowed down that i need a language that can successfully export out to a PDF, so that variables submitted to the program get passed and the character sheet can be print. any suggestions?
many languages should be able to handle this for you. the first question i would ask yourself is what language are you most fluent in?
for me that would be php so i would end up doing this project in a combination of html/js/php.
i have used fpdf for generating pdf that either output to the browser, save to the server, or trigger a download. ( http://www.fpdf.org/ )
fpdf was pretty easy to pick up following the examples.

My jekyll site can't build: Liquid Exception: incompatible character encodings

I do not know what I changed, but today I can no longer build my site's front page with jekyll successfully. It is now complaining about:
[2012-10-30 14:22:10] regeneration: 1 files changed
Liquid Exception: incompatible character encodings: UTF-8 and ASCII-8BIT in index.html
And I'm at a loss to resolve the issue. I believe it's being introduced via a loop of posts I create on the front page, index.html, where I include an excerpt from the last 'n' posts. I used file(1) against my _posts/ directory, and do have some mixture in there:
_posts/2012-08-10-canned-responses-your-silent-partner.md: UTF-8 Unicode English text, with very long lines
_posts/2012-08-21-alternate-ssh-for-osx.md: UTF-8 Unicode English text, with very long lines
_posts/2012-08-21-appus-interruptus.md: ASCII English text
_posts/2012-10-25-emoryfocuslight.md: ASCII English text
_posts/2012-10-28-distributed-social-networking-with-tent.md: ASCII English text, with very long lines
I'm not sure if this is my problem, though. I use vim and bbedit to edit these files, and they're stored in Dropbox (I build/stage in my Dropbox folder but publish elsewhere). Most of my writing/editing is done on OS X.
When I search for this error message I get a lot of hits for rails applications or forcing ruby gems to use a specific encoding, I don't know if that is relevant or would even help me. Would love to be aimed in the right direction or be told how to resolve this situation. It's a sad state of affairs!
A fix is to use the configuration
Jekyll Configuration
Example
encoding: utf-8
No mention of UTF fix
Additionally, you might need to change the code page of the console window to UTF-8 in case you get a “Liquid Exception: Incompatible character encoding” error during the site generation process. It can be done with the following command:
chcp 65001
(From the jekyll "Installation for Windows page": http://jekyllrb.com/docs/windows/)
I have been struggling with this same issue lately and finally found out the root cause.
I went through all post files and noticed that the header matter in some old posts contained following:
title: !binary | {mime encoded string}
Propably the Wordpress migration script, which I had used,
encoded latin1 strings as !binary in YAML and this
caused "incompatible character encodings" error in my case.
I replaced those with correct UTF-8 strings and all went smoothly after that.
Sound daft but re install Jekyll. Then try and re compile your site.
Had a quick google search, bear in mind these are not for Jekyll but ruby so similar.
ruby 1.9 + sinatra incompatible character encodings: ASCII-8BIT and UTF-8
http://www.ruby-forum.com/topic/206925
What have you set the markdown to in your _config?

SugarCRM: Pdf generation

I'm a newbie to SugarCRM development. In my project, I have to generate a pdf for one entity details(say Account details). On details page, I have added "Print PDF" button, upon clicking this button I have one independent script (I mean to say that it was not implemented as per Sugar framework). In this script we are querying database for the required details and building one html string. Using html2pdf library, converting this html string to pdf.
I dont know whether it is an efficient implementation or not, but everything is working fine as per the requirement. But we have one problem when the original string contains some special characters like currency symbols of different countries. We are getting the html fine, but in pdf getting question marks (?) for those special characters.
While trying to fix this issue, when I looked into SugarCRM code, I found some pdf classed inside includes/ directory that creating an impression that Sugar itself has some built-in library to generate pdf's. Is it true?
If that is true, will it solve my problem, i.e. displaying different countries currency symbols in pdf.
Can anybody please help me to in resolving this. Thanks in advance.
-Venkat Nehatha
Venkat, SugarCRM does indeed have its own pdf generation ability. We use it to generate customer orders, quotes, invoices, and statements.
Though I've done some work on the pdf generation myself, I don't think I'm really experienced enough to be able to guide someone else in detail in the use of Sugar's pdf capabilities. I can tell you that we use pdf generation only in our own custom modules, so the files are found in [sugarRoot]/modules/[customModule]/. (You may know that unless you know exactly what you're doing, NEVER modify the main SugarCRM files in the [root]/modules/ folder!) In the previously mentioned custom module folder are two sub-folders, "sugarpdf", which has the code that accesses the modules/database to get the information to write to the pdf, and a "tpls" folder that holds the layout information for the header, body, and footer of the pdf, in HTML format, using the information from the sugarpdf folder's file.
I strongly recommend you visit the SugarCRM developer forums where you will be in touch with many developers much more experienced than me in Sugar.
I hope this helps in some way.

Resources