Hi,
I want to highlight the elements in the webpage for example if i have 3 elements on my webpage and i want to have the cursor for each element for about 10 secs is there any way to do it.
Hi,
I want to highlight the elements in the webpage for example if i have 3 elements on my webpage and i want to have the cursor for each element for about 10 secs is there any way to do it.
Could you be more specific - a screenshot of the web page containg the elements would help
I want to highlight each element and then the test flows for other selections.Thanks for your time
So i just searched for similar topics for you and this @Bob_H has done the work for you - please have a read of the following
Here is a way to do it.
package com.reusableComponents
import org.openqa.selenium.JavascriptExecutor
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement
import org.testng.Assert
import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webui.common.WebUiCommonHelper
import com.kms.katalon.core.webui.driver.DriverFactory
public class HighlightElement {
static WebDriver driver = DriverFactory.getWebDriver()
@Keyword
public static void run(TestObject objectto) {
try {
WebElement element = WebUiCommonHelper.findWebElement(objectto, 20);
for (int i = 0; i < 5; i++) {
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments\[0\].setAttribute('style','background: yellow; border: 5px solid red;');",
element);
}
} catch (Exception e) {
Assert.fail(e.getMessage());
}
}
}
Or have a read of this
I have read that am new to the katalon just exploring the options how can i create a package can you help me with any docs
Sure thing - have a read of this one