Unable to add image.
I am unable to upload the image in browser using the code as show below
When i try to run the code, image is not displaying, in console it showing the error has below:
a1.jpg:1 Failed to load resource: the server responded with a status of 404 (Not Found)
\\\
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Myproject</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<div>
<img src="assests/a1.jpg" height="20" width="40">
</div>
<div>
<app-root></app-root>
</div>
</body>
</html>
There is a spelling error in assets. Spell it assets and not assests and try again
Related
This is the layout code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- theme meta -->
<meta name="theme-name" content="A Hopefull Life" />
</head>
<body>
<div>
#RenderBody()
</div>
<div>
#RenderSection ("myFAQ")
</div>
</body>
</html>
This is the code for the faq.cshtml:
#{
ViewData["Title"] = "FAQ";
Layout = "/Views/Shared/FAQLayout.cshtml";
}
#section myFAQ{
}
This is a simplified code of the entire website, I thought I did everything accordingly, but I got the error message. I thought it was the contents of the section causing the error (which was a few paragraphs) so I removed it but it wasn't the source.
I have a solution made up of the above technologies. I am using knockout components made up of .html and .ts files. When trying a simple <script> tag on the .html file, nothing happens.
The component is payment-details.html and the code is as simple as follows:
<h1>Payment details</h1>
<script type="text/javascript">
alert("test");
</script>
The underlying payment-details.ts is:
import * as ko from 'knockout';
class PaymentDetailsViewModel {
constructor() {
}
}
export default { viewModel: PaymentDetailsViewModel, template: require('./payment-details.html')};
and the _Layout.cshtml file is:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>#ViewData["Title"] Contactless Check In</title>
<base href="~/" />
<environment exclude="Development">
<link rel="stylesheet" href="~/dist/site.css" asp-append-version="true" />
</environment>
</head>
<body>
#RenderBody()
<script src="~/dist/vendor.js" asp-append-version="true"></script>
#RenderSection("scripts", required: false)
</body>
</html>
I'm not sure what the issue is or where to start looking. There's something in the solution somewhere that is stopping script execution. Nor does it render in the html.
Thank you!
// Navigate to Account Managemnt window
Thread.Sleep(10000);
chrome_driver.FindElement(By.XPath("//*[#id='module-menu']/div/button")).Click();
Thread.Sleep(10000);
chrome_driver.FindElement(By.XPath("//*[#id='module-menu']/div/div/button[2]")).Click();
//*[#id="module-menu"]/div/div/button[2]
Thread.Sleep(20000);
IWebElement body = chrome_driver.FindElement(By.TagName("body"));
var result = chrome_driver.FindElement(By.TagName("body")).Text;
Console.WriteLine(result);
IWebElement Single_Acc_Add = chrome_driver.FindElement(By.XPath("//*[#id='single-add-button']/button/span"));
//chrome_driver.FindElement(By.LinkText("+ Add")).Click();
action.MoveToElement(Single_Acc_Add).Build().Perform();
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="/manifest.json">
<link rel="shortcut icon" href="/favicon.ico">
<title>PCR Universe</title>
<link href="/static/css/main.ed365ca1.css" rel="stylesheet">
</head>
<body>
<div
id="GLOBAL_INFO"
data-envvar="-siteminder"
data-clientname="universal-dashboard"
data-clientid="3027d708-26a2-4b63-a131-d672617f46f4"
data-domain="azurewebsites.net"
data-apienvvar="-siteminder"
data-apiname="universalwidgetservice"
data-apidomain="azurewebsites.net"
data-LOGINURL="https://universal-dashboard-siteminder.azurewebsites.net/authorize"
data-LOGOUTURL= './Logout.html'
data-ERRORPAGE= './LoginError.html'
data-ENCODEDCOOKIE= 'false'
data-USETOKENAUTH= 'false'
>
</div>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script type="text/javascript" src="/static/js/main.84c386bd.js"></script>
</body>
</html>
I am working with selenium and came across a website which is not created with java script but react elements, how can i detect IWebElement when there are no html tags. Not able to detect them with link Text as well.
I can't get my style sheet to work in Visual Studio. I have tried quite a few things. Here is my code as it currently is.
Index File (Home Page)
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width"/>
<title>Index</title>
<link href="indexStyleSheet.css" rel="stylesheet" />
</head>
<body>
<h2>red</h2>
</body>
</html>
CSS (The file type is .css)
h2 { color: red;}
Screen shot of file hierarchy
As your css file is in the same directory as your index.html, you don't need to specify a path starting from the root of your project.
This should do it.
<link href="indexStyleSheet.css" rel="stylesheet" />
Edit:
Also, I didn't catch that immediately, what is most likely the cause of all your problems is that your h2 isn't inside the body tag !
I have a HTML page that have an iframe. This iframe has a button. Which is one of the possibile ways to press that button?
I tried with javascript, but I didn't solve it...
Thank you in advance!
hey you can try to find that button id and handle the click event..
it will look something like this.
$('#youriframeid').contents().find('#yourbuttonid').click(function(){});
EDIT
Your main html page containing iframe.
<html>
<head>
<script src="http://code.jquery.com/jquery-1.8.0.min.js" type="text/javascript"> </script>
<script>
$('#a').contents().find('#iframbtn').click(function(){alert("It Worked!")});
$('#a').contents().find('#iframbtn').trigger('click');
</script>
</head>
<iframe id="a" source="a.html">
</iframe>
</html>
Your second html page containing iframe mark up
<html>
<input type="button" id="iframbtn" value="clickme"/>
</html>
Try to use this:
$("#mainiframe").contents().find("someID").trigger("click");
Sample1.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<script>
function call(){
try{
document.frm.but.click();
}catch(e){
}
}
</script>
<BODY onload ="call()">
<iframe src="Sample2.html" name="frm" width=100 height=100 />
</BODY>
</HTML>
Sample2.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<script>
function called(){
alert("---DONE--");
}
</script>
<BODY>
<input type="button" name="but" value="submit" id="but" width=60 height=60 onclick="called()" />
</BODY>
</HTML>
Hope this helps you.