new chromedriver: can't send keys to iframe body - watir-webdriver

Wait-webdriver, chrome-driver
I have the following html code:
<iframe frameborder="0" allowtransparency="true" tabindex="0" src="" title="Rich text editor, ctl00_ContentMain_EditSegment1_txtDesc" aria-describedby="cke_27" style="width:100%;height:100%">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="CSS1Compat" lang="en" dir="ltr">
<head>
<title data-cke-title="Rich text editor, ctl00_ContentMain_EditSegment1_txtDesc">Rich text editor, ctl00_ContentMain_EditSegment1_txtDesc</title>
<link href="http:somefile.css" rel="stylesheet" type="text/css">
<style data-cke-temp="1" type="text/css">
</head>
<body class="cke_show_borders" contenteditable="true" spellcheck="false">
<br type="_moz">
</body>
</html>
</iframe>
I used the following code to set data to the body of the iframe :
#browser.frame(:title => 'Rich text editor, ctl00_ContentMain_EditSegment1_txtDesc').send_keys "description"
Yesterday I updated my chromedriver with new one: https://code.google.com/p/chromedriver/downloads/list
and this line doesn't work for me anymore, but it still works using old chromedriver
Any ideas how can I make it work with new chromedriver?
Thanks,
Anna

Yes, got the same issue. Switched back to old version and got it to work again.
Got all the frameSwitch code in a C# try/catch and no error is given, just an empty textfield.
( Dojo richtext )

The issue fixed in new chromedriver v.2.2:
https://code.google.com/p/chromedriver/downloads/list

Related

Visual Studio code beautify format issues

I'm using VS Code + js-beautify + Beautify css/sass/scss/less, and I'm facing couple of annoying issues when I format my code (don't know how to solve them):
This is NOT how I want my background color to look.
From:
background-color: rgba(0, 0, 0, .0);
To:
background-color: rgba(0,
0,
0,
.0);
I want it to be format as one line (like "from").
The "cursor" property is in different color
When I format my html code, there are line spaces in the body and the html.
From:
<!DOCTYPE html>
<html lang="en">
<head>
<title>React App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
To:
<!DOCTYPE html>
<html lang="en">
<head>
<title>React App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
I want it to be formatted without any empty spaces (like "from").
You can change format settings in VS Code's settings.json file. By default, head, body and html tags include a newline before them. If some issues started happening only after installing an extension, then there may be conflicting settings.
While this is an old question, I was encountering the same issue and found the solution. In your VS Code settings.json, add the following to it:
"html.format.extraLiners": "",
By default nothing is there so it will default to html, body, /html. By setting it to nothing, it will give you the behavior you want.

Is it necessary to define <head> and <body> with "loadHTMLString" in UIWebView?

Is it necessary to define <head> and <body> with "loadHTMLString" in UIWebView?
When using loadHTMLString:baseURL: in UIWebView, Those two HTML comes same result.
1.
<html> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/> <meta name=\"viewport\" content=\"width=device-width, user-scalable=yes\"> </head> <body> <div class=label1-con3> <font color=#ff0000 size=3> <strong>Test</strong></font> </div> </body> </html>
2.
<div class=label1-con3> <font color=#ff0000 size=3> <strong>Test</strong></font> </div>
no it is not necessary at all, it's just user's requirement that how they wanna show their web template. So it's not necessary for all to use this kind of stuff it's just requirement that changes per senario.
No, its not necessary to add these tags.
You can add string of your own and it will work fine

HTML Code Is Not Rendering Properly

I'm having problems with my HTML and jQuery Code. I was wondering if someone could tell me what's wrong with it. Here's the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Main Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Scripts -->
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js"></script>
<!-- Stylesheets -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css" />
<!-- Color Scheme -->
<!-- Beige: #eee8cd; Green: #008b8b; Blue: #203471; -->
</head>
<body>
<div id="MainPage" style="background:#008b8b;color:#203471" data-role="page">
<div style="background:#008b8b;color:#203471" data-role="content">
<p style="background:#008b8b;color:#203471"><img alt="" src="Images/Header.png" style="width:100%" /></p>
<p style="background:#008b8b;color:#eee8cd">The content for the main page is here</p>
<a style="background:#eee8cd;color:#203471" href="AboutUs.htm" data-role="button">About Us</a>
<a style="background:#eee8cd;color:#203471" href="ContactUs.htm" data-role="button">Contact Us</a>
</div>
<div style="background:#203471;color:#eee8cd" data-role="footer">
<h4>Main Page Footer</h4>
</div>
</div>
</body>
</html>
There are two problems that I am having problems figuring out:
1) When I put this code on my web server and navigate to it via my iPhone it is fine when the phone is held in the vertical position. When the phone is moved into the horizontal position though, the buttons seem to be displayed over the text and are not workable. Any ideas on how to resolve this?
2) I tried to create a custom stylesheet.css and link to it via the class attribute of the various tags. This would not work so I had to put the inline code (for example:)
<div style="background:#203471;color:#eee8cd"
Can someone show me how to create a stylesheet.css with these attributes and "tag" them in the HTML so that this works?
Thanks So Much.
Well, you've got a link to jQuery where your link to your CSS should go. Check out www.codecademy.com !
I've separated inline css to its own and seems to render fine.
Play with this fiddle here http://jsfiddle.net/kVqWJ/
You can include css files in your html file many ways:
1)
<style type="text/css">
//your style here
</style>
2)
<link rel="stylesheet" type="text/css" href="css url here">
A quick googling will help. The Mozilla developer network is a great place to start.

like button internet explorer white box appearing

I have some code to display a like button and this shows but with a random white box that i dont really want. Works in all other browsers
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"><body>
<iframe src="http://www.facebook.com/plugins/like.php?href=<SITE URL>"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"><iframe>
</body>
</html>
I also had this issue.
Closing the iframe tag did not provide a solution to my problem.
Use the following:
<iframe style="visibility:hidden;" onload="this.style.visibility = 'visible';" src="../examples/inlineframes1.html" > </iframe>
This resolved the issue for myself.
You forgot to close the iframe and instead opened another one. Try changing the second <iframe> to </iframe>.
just close the iframe please :)
try this :
<iframe src="http://www.facebook.com/plugins/like.php?href=<SITE URL>"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>

Jquery live with select method problem in internet explorer

I want to use jquery live() to automatically select the text in a text box but it doesn't seem to work in internet explorer 8. Here's the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script>
<script type="text/javascript">
$(function(){
$('input.textInput')
.live('focus',
function(e){
$(this).select();
// alert(1) // if i uncomment this it works
});
});
</script>
</head>
<body>
<input type="text" class="textInput" value="0,00" />
</body>
</html>
If, however, i uncomment the alert(1) statement it does work. Any ideas what the problem is here?
This is strange, it also works if you don't use the live event:
http://jsfiddle.net/JKVXU/1/
Try
$('input.textInput').live("focus",function(e){
$(this).focus(function () {
$(this).select();
});
});
http://jsfiddle.net/JKVXU/23/
Have you tried using val() to get the text box vlaue instead?
I think the browser doesn't like the integer value on the alert.
try this: alert('1');