boolean type display of search data - radio-button

Hi I need to display below search result in a colored radio button type
splunk search result:
2022-06-07 08:36:33:980 PDT - SRE_Logging [INFO] appNameCheck="1",passwordCheck="0",configCheck="0"
0 means it is not OK, so red color radio button
and 1 means it is OK, so green color radio button
enter image description here

Related

CKEditor 5 - heading dropdown label

Is it possible to change the heading dropdown label?
The solution I found doesn't work as expected. The label turns into 'choose heading' value when I click any list option.

Colors[4] not showing color selection on Front Panel

I am trying to set the color of an indicator to different colors based on different values, like 1 = red, 2 = blue etc. Using guidance from a Youtube video (accessible using this link: https://www.youtube.com/watch?v=czUmPQmKmGU), I have created a Colors[4] control for the indicator I have after changing it to the "write" function.
The Problem on the front panel is that I am getting a control with numbers instead of a color box where I can select the colors to show based on the value. This was the control I got instead.
This is the control I am trying to achieve (below):
Is there any way that I can get the color box on my control instead of the number controls? I am not sure if it can be changed through a control on the front panel or something but what I have tried so far keeps leading me back to this problem.
Any advice is much appreciated
A color box control is just a U32 number (three bytes for RGB and one which is always 0), which is why that's what you get.
There is a right click plugin which adds a replace with color box option directly to the right click menu of unsigned 32 bit numbers, but I don't remember if it ships with LV or not.
If you don't have that, you can always just right click the indicator inside the cluster, select replace and navigate the palettes to find the color box. You can also copy a color box and then select the indicator and paste, which replaces the selected control.
The color[4] is actually an array of 4 colors (UInt32 as Yair said), that define 2 color gradients, one for the 'Off' state, and the other for the 'On' State of the control.
If you want to set the control's color, you will have to define all 4 of them.

Using sendKeys() without clicking on element in Selenium

I want to input a string then format it using Cleditor. However, when I clicked on the B icon then clicked back on the text area frame to input the text, it lost the bold effect. Then I found out that if I clicked on the B icon, then input the text immediately WITHOUT clicking back on the text area frame, the text would be bold.
Unfortunately I use sendKeys() right after the clicking on B icon code, so it clicks on the text area frame and lose all the bold effect. Here's my code:
clickElement(driver.findElement(By.xpath("//div[#title='boldText']"))); **//click on the bold icon**
**//switch to the textarea frame**
clickElement2();
driver.switchTo().frame(0);
Thread.sleep(1000);
new Actions(driver).sendKeys(driver.findElement(By.xpath(".//*[#class='cleditor-content']")), "abc").perform();
Is there anyway I can input the text without clicking on the text area? Any solution will be appreciated.
As I suggest before in the comments, try to input the text, highlight it and then click the B (bold) button.
Example of that in C# code (should be pretty similar in Java):
var actions = new Actions(WebDriver);
actions.SendKeys(< yourElement >, "your text").KeyDown(Keys.LeftShift).SendKeys(Keys.Home)
.KeyUp(Keys.LeftShift).Build().Perform();
boldButton.Click();

how can I know back ground color of a button?

I have "1 to 10" and a "DRAW" i.e total eleven buttons on the screen.
Each of the "1 to 10" button initially will have a gray color.
When user presses the "DRAW" button a 1 to 10 random number is generated.
The button corresponding to generated random number shall become red.
Next time when user again presses the DRAW button I want to ignore the random number generated if its corresponding button is already red.
How can I test the color of a button and take decision accordingly.
Please help.
Thanks-arun karkare
How about this for the color:
if(button.getColor() == Color.RED) {
// Do something
}
Sorry, I don't know how to then igore this from the random number generator.

Get checked status of radio buttons in a Data Repeater

I have a Data Repeater in a Windows Form, within the data repeater I have a label and either a radio button or combo box, the amount of radio buttons and the text for them is brought in from my database as is the label and combo box.
The label is a question and the radio buttons or combo box allows the user to answer the question.
What I want to do is get the checked status of the radio buttons so I can then reveal the next question if it is needed. e.g. only show question 2 if question 1 is answered No.
'0 = Index in Repeater.
Dim bolChecked As Boolean = CType(rptYourRepeater.Items(0).FindControl("IdOfRadioButton"), RadioButton).Checked