Articles on Trending Technologies

Technical articles with clear explanations and examples

How to remove a member from the local group using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 02-Nov-2020 7K+ Views

To remove a member from the local group using PowerShell, we can use the RemoveLocalGroupMember command. This command is available in the module Microsoft.PowerShell.LocalAccounts in and above PowerShell version 5.1.To use this command, we need to provide two parameter values. One is the -Group (Local Group Name) and the second is -Member (Name of the Member to remove). For example, Remove-LocalGroupMember -Group Administrators -Member TestUserThe above command will remove TestUser from the local group Administrators.To use the above command on the remote computer, we need to use Invoke-Command. For example, Invoke-Command -ComputerName Test1-Win2k12, Test1-Win2k16 -ScriptBlock{    Remove-LocalGroupMember -Group "Administrators" -Member ...

Read More

How to create a new local group using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 02-Nov-2020 1K+ Views

To create a new local group on the local or the remote system using PowerShell, we can use the NewLocalGroup command. ExampleNew-LocalGroup -Name "TestGroup" -Description "Test Group"OutputName       Description ----       ----------- TestGroup Test GroupYou can verify it from the Computer Management GUI.To create the local group on the remote systems, you can use Invoke-Command. For example, Invoke-Command -ComputerName Test1-Win2k12, Test1-Win2k16 -ScriptBlock{    New-LocalGroup -Name 'TestGroup' -Description 'New Test Group' }The above command will create a New Local group named ‘TestGroup’ on the remote systems, Test1-Win2k12, and Test1-Win2k16.New-LocalGroup command is available in the module Microsoft.PowerShell.LocalAccounts which is part ...

Read More

How to get the list of local groups using PowerShell?

Chirag Nagrekar
Chirag Nagrekar
Updated on 02-Nov-2020 14K+ Views

To get the local groups on the windows system using PowerShell, you can use the Get-LocalGroup (Module: Microsoft.PowerShell.LocalAccounts) command. This command will list down all the groups on the particular system.If we check the properties of this command, it supports Name, Description, ObjectClass (user or group), PrincipalSource (ComputerName – Local or Remote), SID (Security Identifier).We will select them, PS C:\> Get-LocalGroup | Select Name, Objectclass, Principalsource, sid Name                                              ObjectClass PrincipalSource    SID ----           ...

Read More

Count of distinct sums that can be obtained by adding prime numbers from given arrays in C++

Sunidhi Bansal
Sunidhi Bansal
Updated on 31-Oct-2020 271 Views

We are given two arrays containing prime and non prime numbers. The goal is to find the count of distinct sums of pairs of prime numbers in each array. We will do this by making a pair of two primes from each array, take their sum and add them to set sums. In the end the size of the set is the number of distinct sums of primes. Let's understand with examples. Input Arr1[] = { 1, 2, 3 } Arr2[] = { 2, 3, 4} Output Distinct Sums of primes :3 Explanation Prime pairs ...

Read More

Count numbers whose difference with N is equal to XOR with N in C++

Sunidhi Bansal
Sunidhi Bansal
Updated on 31-Oct-2020 194 Views

We are a number N. The goal is to find numbers between 0 and N whose difference with N is equal to XOR with N.We will do this by traversing no. from i=0 to i

Read More

Count pieces of the circle after N cuts in C++

Sunidhi Bansal
Sunidhi Bansal
Updated on 31-Oct-2020 177 Views

We are given an integer N which represents the number of cuts applied on a 2D-circle. Each circle divides the circle in two halves. Goal is to find the pieces of the circle after N cuts.Number of pieces= 2 * no. of cutsLet’s understand with examples.Input − N=1Output − Pieces of circle: 2Explanation −Input − N=3Output − Pieces of circle: 6Explanation −Approach used in the below program is as followsWe take N for a number of cuts.Take pieces=1*N.Print the result..Example#include using namespace std; int main(){    int N=2;    Int pieces=2*N;    cout

Read More

How do I change focus to a new popup tab in Selenium?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 26-Oct-2020 4K+ Views

We can change focus to a new popup tab with Selenium webdriver. The getWindowHandles and getWindowHandle methods are available to handle new popup tabs. The getWindowHandles method stores all the currently opened window handles in Set data structure.The getWindowHandle method stores the window handle of the opened browser in focus. The iterator method is used to iterate over all the window handle ids. We have to add import java.util.Set to accommodate Set and import java.util.List and import java.util.Iterator statements to accommodate the iterator in our code.Selenium driver object can access the elements of the parent window. In order to switch ...

Read More

How to wait until an element no longer exists in Selenium?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 26-Oct-2020 8K+ Views

We can wait until an element no longer exists in Selenium webdriver. This can be achieved with synchronization in Selenium. We shall add an explicit wait criteria where we shall stop or wait till the element no longer exists.Timeout exception is thrown once the explicit wait time has elapsed and the expected behavior of the element is still not available on the page. To check if an element no longer exists on the page, we can take the help of the expected condition invisibilityOfElementLocated.To implement explicit wait conditions, we have to take help of the WebDriverWait and ExpectedCondition class.ExampleCode Implementation.import ...

Read More

Selenium Web Test Automation Framework Best Practices.

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 26-Oct-2020 487 Views

The best practices for Selenium web test automation framework are listed below −Use of dynamic waits like implicit wait and explicit wait instead of using Thread.sleep in the framework to handle sync issues in the application.Usage of Page Object Model framework design to segregate the test scripts from the locators. In case of changes in the webelement properties, test scripts need not be modified only the locators undergo change.Usage of Behavior Driven Development framework. This allows the participation of all members in the agile team to participate in product development.Encourage testing to start from very early phases and in regular ...

Read More

How do you click on an element which is hidden using Selenium WebDriver?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 26-Oct-2020 10K+ Views

We can click on an element which is hidden with Selenium webdriver. The hidden elements are the ones which are present in the DOM but not visible on the page. Mostly the hidden elements are defined by the CSS property style="display:none;". In case an element is a part of the form tag, it can be hidden by setting the attribute type to the value hidden.Selenium by default cannot handle hidden elements and throws ElementNotVisibleException while working with them. Javascript Executor is used to handle hidden elements on the page. Selenium runs the Javascript commands with the executeScript method. The commands ...

Read More
Showing 51071–51080 of 61,297 articles
Advertisements