In November 2023, we announced Knowledge Bases for Amazon Bedrock as generally available. Knowledge bases allow Amazon Bedrock users to…
Development
Originally PyTorch used an eager mode where each PyTorch operation that forms the model is run independently as soon as…
Large language models (LLMs) have gained significant attention in recent years, but ensuring their safe and ethical use remains a…
Concept-based learning (CBL) in machine learning emphasizes using high-level concepts from raw features for predictions, enhancing model interpretability and efficiency.…
I have Jquery calender in my application. I have task to select dates from different months using Selenium, but I can do only previous month and forward month. Actually I need to select dates from random months by specifying the date and month as input. If there is a way to achieve it let me know.
**My code for Selecting Previous Month date.**
public static void Date_Picker(String datetoselect,String Xpath,String month) {
// Click on the Given Calender Button
driver.findElement(By.xpath(Xpath)).click();
driver.findElement(By.xpath(“//div[@id=’ui-datepicker-div’]/div/a[1]”)).click();
WebElement Month = driver.findElement(By.xpath(“//div[@id=’ui-datepicker-div’]/div/div[@class=’ui-datepicker-title’]/span”));
String Month_Message = Month.getText();
if(Month_Message.contains(month))
{
WebElement dateWidget = driver.findElement(By.className(“ui-datepicker-calendar”));
List<WebElement> rows=dateWidget.findElements(By.tagName(“tr”));
List<WebElement> columns=dateWidget.findElements(By.tagName(“td”));
for (WebElement cell: columns){
if (cell.getText().equals(datetoselect)){
cell.findElement(By.linkText(datetoselect)).click();
break;
}
}
}
We are trying to get our automated webtests working independently of what version of Chrome we’re using. These automated tests work as follows:
We have a Karaf container agent running as a service;
Karaf starts an ant script, which in turn starts another ant script. The first ant script is part of the automation tool we use (our own product) and the second ant script is the actual script that starts our testng webtests;
TestNg, during the startup, starts the ChromeDriver in the following way using the bonigarcia Webdrivermanager library:
WebDriverManager.chromedriver().setup();
// webDriver = new ChromeDriver();
ChromeOptions options = new ChromeOptions();
// ChromeDriver is just AWFUL because every version or two it breaks unless you pass cryptic arguments
//AGRESSIVE: options.setPageLoadStrategy(PageLoadStrategy.NONE); // https://www.skptricks.com/2018/08/timed-out-receiving-message-from-renderer-selenium.html
options.addArguments(“–enable-automation”); // https://stackoverflow.com/a/43840128/1689770
options.addArguments(“–headless”); // only if you are ACTUALLY running headless
options.addArguments(“–no-sandbox”); //https://stackoverflow.com/a/50725918/1689770
options.addArguments(“–disable-infobars”); //https://stackoverflow.com/a/43840128/1689770
options.addArguments(“–disable-dev-shm-usage”); //https://stackoverflow.com/a/50725918/1689770
options.addArguments(“–disable-gpu”); //https://stackoverflow.com/questions/51959986/how-to-solve-selenium-chromedriver-timed-out-receiving-message-from-renderer-exc
options.addArguments(“–window-size=1920,1080”);
options.addArguments(“–start-maximized”);
options.addArguments(“–disable-extensions”);
options.setExperimentalOption(“useAutomationExtension”, false);
options.addArguments(“–bwsi”);
options.addArguments(“–user-data-dir=”+ System.getProperty(“test.web.chrome.data.dir”) +”/user-data-dir”);
options.addArguments(“–disk-cache-dir=”+ System.getProperty(“test.web.chrome.data.dir”) +”/disk-cache-dir”);
try {
File logFile = new File(System.getProperty(“test.web.chrome.data.dir”).replace(“/”, “\”) + “\logs\chromedriver.log”);
logFile.getParentFile().mkdirs();
logFile.createNewFile();
boolean verbose = System.getProperty(“test.web.webdriver.verbose”).equals(“true”);
ChromeDriverService driverService = new Builder().withVerbose(verbose).withLogFile(logFile).build();
webDriver = new ChromeDriver(driverService, options);
} catch (IOException e) {
LOGGER.error(e);
webDriver = new ChromeDriver(options);
}
The problem we have is that if the Karaf agent is running as the LOCAL_SYSTEM account (which is the default user when creating a new service), the Chromedriver can’t start Chrome with the error:
unknown error: cannot create temp dir for unpacking extensions
After some googling and testing, I’ve found this is because when starting the ChromeDriver, it tries to create a temporary folder for unpacking extensions in the user temp directory, which fails because the LOCAL_SYSTEM account doesn’t have a user directory.
I can work around the issue by making the service run as a LOCAL_SERVICE account, which does have a user directory, but we’ve found that some other scripts that run on this Karaf agent give problems when running as LOCAL_SERVICE (mainly older software integrations that we can’t easily upgrade), so ideally I’m hoping for a solution that makes LOCAL_SYSTEM work.
Is there a way to fix the temp dir problem that the Chromedriver has when attempting to start Chrome from a LOCAL_SYSTEM service?
In my college, I learned about Integration testing in which we combine the whole code together and then test it at once after we are done with unit testing.
A few days back, I heard about Jenkins, which says it does Continuous Integration Testing. I read about it and learned that it means that a developer pushes his/her code several times a day to Jenkins for testing instead of sending the code at the end of the day.
I was confused so I went to read about it from Wikipedia but it didn’t help. I read the two links below
Integration testing
Continuous integration
ELI5
What does this all mean?
What is the difference between Regular Integration Testing and Continuous Integration Testing?
How do I find the element with text “Jessica” based on “3000” displaying in the web page using xpath?
I’m getting …not a valid xpath error.
<div>
<span><b>Jessica</b></span>
<br>
<label>Total Wealth ($):</label>
<p>3000</p>
</div>
I tried this
RichestPersonName = browser.find_element_by_xpath(“//p[text()=’3000′] .. /span”).text
but it shows
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //p[text()=’3000′] .. /span because of the following error:
SyntaxError: Failed to execute ‘evaluate’ on ‘Document’: The string ‘//p[text()=’3000′] .. /span’ is not a valid XPath expression.
RSOS is a minimalist system based on Debian Linux. The post RSOS – minimalist Debian-based Linux distribution appeared first on…
Damask is a simple utility that automatically sets wallpaper images by selecting images from a variety of sources. The post…
The First Descendant has been getting a lot of attention lately, but does it support cross-progression and crossplay? Source: Read…
Frostpunk 2 is on the way, bringing a much larger scope for 11 bit studios’ city-building survival experience. Here’s everything…
Here are the best characters to play as in, The First Descendant — the latest free-to-play third-person looter-shooter from Nexon…
On Windows 11, you can add or remove RSAT in at least two ways using the Settings Optional features settings…
I had the chance to speak with Avowed’s Creative and Gameplay Directors on combat and gameplay, choices and consequences, companions…
Microsoft issues fix for the bug affecting the Copilot experience in Windows 10 when using a multi-monitor configuration. The bug…
The sequel to Red Hook Studio’s critically acclaimed roguelike dungeon-crawler with turn-based combat is getting an Xbox port. Source: Read…
Capcom has just released a playable demo for its upcoming action-strategy game, Kunitsu-Gami: Path of the Goddess. In addition, Capcom…
A step-by-step guide showing how to use container queries with cross-browser fallbacks. Source: web.dev: BlogÂ
Discover some of the interesting features that have landed in stable and beta web browsers during June 2024. Source: web.dev:…