I am having some UI testcases, which are run using a Azure DevOps release pipeline. These testcases are working in Chrome and Firefox when I enable headless mode.
Now I want to enable a headless mode for Internet Explorer(IE11). When I searched on the web I found that this can be achieved using TrifleJs. How can implement TrifleJs in Visual Studio 2019? Can somebody provide the C# code?
Browser : IE11,
Server : Windows Server 2019 Datacenter
As far as I know, IE does not have support for a headless mode.
From the TrifleJs document, the TrifleJs is a kind of browser that can emulate some IE versions in a headless mode and execute JavaScript script, since its coded as a port of PhantomJS.
At present, it is an executable file, instead of a kind of SDK or API, so, we could not directly add it in C# application. I suggest you could check the document to use this tool, and you could also feedback this issue to trifleJS forum
Related
How can I automate testing of a non-automation enabled desktop application using Appium, WinAppDriver, Visual Studio, and C#? The application is not showing any XPath or other identifying elements. Are there any techniques or methods that I can use to enable automation support for the application and allow me to perform automation testing?
I am using Appium version 1.17, WinAppDriver version 0.7, Visual Studio 2019 and C# to try to automate testing of a custom built non-automation enabled desktop application. The application is a accounting software with custom functionality.
I have tried to locate identifying elements or XPath of the application by using inspect.exe but it did not find any xpath or identifying elements. I also tried to enable the automation support but it was not successful and the application was not responding.
I am getting the error "element not found" when trying to interact with the application using Appium and WinAppDriver.
Any suggestions to automate this application using the above mentioned tools would be highly appreciated.
I personally use appium inspector that you can find going to this link.
https://github.com/appium/appium-inspector
You will need appium server running to get this working.
I am working on my college project to build a Web Browser. I am Halfway through My Project and i came to know that WebBrowsers need javascript interpreters to Display latest websites.I am using c# language in Visual studio 2012. It Still Displays Some of the Basic Webpages but Doesn't Displays latest updated webpages like Google maps. I tried to suppress the error but doesn't help in other high end web pages. So how can i build a javascript interpreter and install it in my web browser.
Code I used to suppress the error
c# getCurrentBrowser().ScriptErrorsSuppressed = true;
The reason is that, you code is using the IE browser of your windows. IE often have incompatibilities. Try doing some research and inject a proper browser like chromium or gecko.
Look at this package
I am trying to use Selenium Webdriver in visual studio to check a website. Everything worked fine when I was using just Chromedriver, but now that I have added the Microsoft Webdriver to test the site using Edge I am having issues. I made sure to download the correct version of the webdriver for my os build.
Every other time I go to run my test visual studio encounters a build error.
Warning Could not copy "C:\Desktop\UnitTestProject3\packages\Selenium.WebDriver.MicrosoftDriver.17.17134.0\build..\driver\MicrosoftWebDriver.exe" to "C:\Desktop\UnitTestProject3\UnitTestProject3\bin\Debug\MicrosoftWebDriver.exe". Beginning retry 9 in 1000ms. The process cannot access the file 'C:\Desktop\UnitTestProject3\UnitTestProject3\bin\Debug\MicrosoftWebDriver.exe' because it is being used by another process. The file is locked by: "Microsoft Web Driver (12804), Microsoft Web Driver (12340), Microsoft Web Driver (1124), Microsoft Web Driver (19756), Microsoft Web Driver (2592), Microsoft Web Driver (12736), Microsoft Web Driver (19604), Microsoft Web Driver (12428), Microsoft Web Driver (18604), Microsoft Web Driver (10500), Microsoft Web Driver (12724)"
If i dismiss the error and then run the test one more time it runs fine. Has anyone ran into this before?
Any help would be appreciated!
Thanks
Check your processes, May be MicrosoftWebDriver.exe is still running in process and that's why you would get build error.
If script fails abruptly, you need to handle your code to quit driver. Otherwise driver will remain active in processes.
We have a set of Selenium tests in c# project with xunit.
We use headless chrome and tests are running just fine on PCs with Chrome installed.
However, on build agents we don't have Chrome, so we receive an exception cannot find Chrome binary.
Is there any way to ship Chrome within test project as a standalone exe, so we don't have to install it on the servers?
Any other suggestions?
There is an option to achieve what you are after, via portable Chromium bundle
within test project as a standalone exe
Basic steps are:
download desired version from their page
unzip
run chrome.exe
Main advantages of the portable browser are that you can carry it with your projects anywhere, avoiding installation and dabbling with the windows registry.
It is true that Chromium is the open-source version of Chrome itself, but is efficient enough just like Chrome. Keep in mind that there are some functionality differences, when it comes to flash and PDF.
I am doing website automation testing and am stuck with entering basic authentication credentials in C# using ChromedDriver, I have searched a lot of old posts and tried different approaches, but I haven't found anything working for me.
There are some old post to enter UserName Password in URL, i.e
this.driver.Navigate().GoToUrl(http://username:password#TestURL), But this has been stopped supported by Chrome.
I tried to use AutoIt, it works locally but doesn't work on TeamCity build, looks like it requires TeamCity to run on console mode (not service mode), which is not an option for my situation.
AutoItX.Send(MyUserName);
AutoItX.Send("{TAB}");
AutoItX.Send(MyPassword);
AutoItX.Send("{Enter}");
Another approach is using WinAppDriver, again, it works on my local Windows 10 PC, but it's doesn't support Window 7, 8 or Windows 2012 server, so it's not an option for me.
Could anyone please help if you have working solutions?