Automate Future
0 FOLLOWERS
We automate something to make our life easier. As automation testers, we all have met so many challenges while trying to automate a particular scenario or an application. Whether the challenge is on Tool , Coding Language, Third-party apps or a tricky logic, but somehow we all have overcome that and completed the task. So why lose all those precious information we gathered while overcoming the..
Automate Future
3y ago
If we have an SSO application and we want to login to the application with those credentials, we can use a small modification to our driver properties.
Add the following argument to driver options and it will use the existing user credentials.
string loggedInUser = System.Environment.UserName; //read the Logged in user namedriverOptions.AddArguments(@"user-data-dir=C:\Users\" + loggedInUser + @"\AppData\Local\Google\Chrome\User Data");
We may get the below error while continues execution of the scripts using selenium.
OpenQA.Selenium.WebDriverException: invalid argument: user data dir ..read more
Automate Future
3y ago
If our application is of type angular, the normal selenium SelectElement class may not work. Especially if the select dropdown allows multi-select.
Normal Scenario:
SelectElement selectElm = new SelectElement(tempSelectElement);
In angular scenario we may need to do some more action to select an element by using clicks, looping, split and send keys.
The steps we need to do will be
Click on the down arrow in select dropdown
Get the list of all select options inside the dropdown by getting child items
Pass the needed item as a parameter and click on the needed item
Repeat this for all ite ..read more
Automate Future
3y ago
This exception will be thrown by selenium mostly while loading a page. If our application is an angular application chance of this exception is more.
Most probably a spinner or any other loading page will be blocking our code from clicking the desired object.
One such scenario is shown below, where a spinner blocks our element to click.
OpenQA.Selenium.ElementClickInterceptedException: element click intercepted: Element <a >...</a> is not clickable at point (1239, 86). Other element would receive the click: <div >...</div>
Here instead of our object, the script wi ..read more
Automate Future
3y ago
We may come across different scenarios where we need to get the list of all applications/processes running in the background of the Window OS.
Manually we can go to the task manager and check the processes tab to see the list.
But if we are trying to automate a scenario and if we want to do any action like Kill the process, close the process, Get the runtime of the process, Know used memory, etc we may need to take the list of running processes programatically.
For that, we can use the Processes method under System.Diagnostics Class
A sample code to get all running proccesses and pri ..read more
Automate Future
3y ago
Since the ordered tests in visual studio are depreciated, we now need to find another way to combine different test methods and run them in a specific order.
For this, we need to programmatically invoke the test methods by calling all the test methods we need inside another test method.
A sample is given below.
//Test cases[TestMethod]public void TestMethod1(){reporthandle.LogReport("Passed", "Test", "Test Description");}//Test cases[TestMethod]public void TestMethod2(){reporthandle.LogReport("Failed", "Test", "Test Description");}//Ordered test creation using .Net Code[TestMetho ..read more
Automate Future
3y ago
Here the DatePicker combines the Kendo UI Date Input and Calendar components to enable the user to pick a date from the calendar shown in UI.
Kendo Date picker can be of different types, CSS selector in selenium is the most apt to way to enter values to a kendo-dateinput.
If we try to enter the value to the Kendo inputbox directly using XPath , we may get the below error.
OpenQA.Selenium.ElementNotInteractableException: element not interactable
In this case, the only option in front of us is to do clicks on elements inside the calendar one by one.
But this becomes if the page is scrollable and ..read more
Automate Future
3y ago
Kendo UI is a framework provided by Telerik which provides interactive controls in websites.
If you are trying to automate any of the Kendo widgets, it will be difficult to find controls since it uses jQuery.
So we may have to find controls of those elements in an unconventional way.
Usually, we use XPath to find elements and do actions. In kendo, since this is an angular widget we may not be able to find the XPath.
So the solution to find controls is to use a CSS selector in selenium.
Kendo Date picker comes in different types. Let's consider one example and check how we can automate th ..read more
Automate Future
3y ago
If we are migrating from one version of Visual studio to another we may come across this issue.
Where our code will not recognize the run settings file even though we selected in from Test > Configure Run Settings > Select solution wide run setting file
The build will be succeeded, but an error "Unexpected error detected. Check the tests Output Pane for details" will be shown.
Now to see the error we need to open the Output pane, View>Output
And select the Test option from Output pane dropdown.
Now you can see the error as below
System.InvalidOperationException: No plugin foun ..read more
Automate Future
3y ago
It's always good to keep a link to the professional account of the author in your blog or website.
We can use different widgets provided by websites or we can custom create one.
Below is such a code that we can use to provide a link to our LinkedIn profile. It uses the same theme as the LinkedIn website.
Use this code anywhere inside your website HTML to get the widget shown there.
<div class="LI-profile-badge" data-locale="en_US" data-size="medium" data-theme="dark" data-type="vertical" data-vanity="Profile-Name" data-version="v1"><a class="LI-simple-link" href="Account URL f ..read more
Automate Future
3y ago
org.xml.sax.SAXParseException; * The reference to entity "type" must end with the ';' delimiter
This error happens when the HTML tries to execute the javascript and doesn't meet the syntax criteria.
In case if we are using any Syntax highlighter or any type of Adsense javascript in our code we may face this issue.
Follow the below two steps to fix this.
Replace all “&” with “&” in your new HTML/Javascript code that you are trying to include
This must fix your issue.
If the issue still persists follow the next step
Copy the “&” changed ..read more