how to get height of web page
Dimension initial_size = driver.manage().window().getSize();
int height = initial_size.getHeight();
int width = initial_size.getWidth();
how to get height of web page
Dimension initial_size = driver.manage().window().getSize();
int height = initial_size.getHeight();
int width = initial_size.getWidth();
how to find total height of single page page in html
function calculateTotalHeightMinusElement(excludeElementClass)
{
// Get all child elements of the body tag
var bodyChildren = (document.getElementsByTagName('body')[0]).children;
var totalHeight = 0;
// Loop through the selected elements
for (var i = 0; i < bodyChildren.length; i++) {
// Add the height of this element
totalHeight = totalHeight + bodyChildren[i].offsetHeight;
}
// Get the height of the element we want to exclude
var excludedElementHeight = document.getElementsByClassName(excludeElementClass)[0].offsetHeight;
// Calculate height minus the excluded element
var finalHeight = totalHeight - excludedElementHeight;
// Display the final height in an alert
alert("Total height: " + finalHeight);
}
document.addEventListener("DOMContentLoaded", function(event) {
// Pass in the class name of the element you want to minus from the height calculation
calculateTotalHeightMinusElement("myDivClass");
});
how to get height of web page
Dimension initial_size = driver.manage().window().getSize();
int height = initial_size.getHeight();
int width = initial_size.getWidth();
how to find total height of single page page in html
function calculateTotalHeightMinusElement(excludeElementClass)
{
// Get all child elements of the body tag
var bodyChildren = (document.getElementsByTagName('body')[0]).children;
var totalHeight = 0;
// Loop through the selected elements
for (var i = 0; i < bodyChildren.length; i++) {
// Add the height of this element
totalHeight = totalHeight + bodyChildren[i].offsetHeight;
}
// Get the height of the element we want to exclude
var excludedElementHeight = document.getElementsByClassName(excludeElementClass)[0].offsetHeight;
// Calculate height minus the excluded element
var finalHeight = totalHeight - excludedElementHeight;
// Display the final height in an alert
alert("Total height: " + finalHeight);
}
document.addEventListener("DOMContentLoaded", function(event) {
// Pass in the class name of the element you want to minus from the height calculation
calculateTotalHeightMinusElement("myDivClass");
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us