how to open a different browser in telerik test script - c#

I am testing a chat functionality on the user interface.
so I will be logging in as user 1 from IE and log in in as user 2 on Firefox.
So I want to know what is the syntax to do this in telerik test file using c#.
I have checked online and have found various links for cross browser testing which is mainly running the same test on different browser.
But I want to launch a new browser from a test script
Can someone please share some inputs and any helpful links?
thanks

you could try something as simple as this
System.Diagnostics.Process.Start("firefox.exe", "http://www.msn.com");
if firefox is not added to your %Path% then fully qualify the location of where the .exe is like this
System.Diagnostics.Process.Start(#"C:\Program Files\Mozilla Firefox>firefox.exe", "http://www.msn.com");

Related

Use selenium to log in chrome with different user

Now I want to do automated web testing with selenium in Specflow, and I have several credentials to test. The question is How to switch domain to log in chrome browser with C# code in selenium. I have tried the solution in this But I found the new chromedriver() cannot be modifiied. I can do manually change the domain by shift and right click chrome browser to run as a different user, but I can't solve it automaticaly.

How to communicate with Google Chrome using C# or Python

I'm developing a software on C# which has to get info from a website which the user opens in chrome, the user has to input some data and then the website returns a list of different items.
What I want is a way to be able to access to the source code of the page in order to get the info, I cant open the web myself as it doesnt show anything because I didnt input any data, so I need to get it directly from chrome.
How can I achieve this ? A chrome extension ? Or can I access to chrome directly from my software ?
Off the top of my head, I don't know any application that gets data directly from an open instance of Chrome. You'd have to write your own Chrome extension.
Alternatively, you can open the web browser from your application initially.
You can look into these libraries for doing so:
Watin (My personal favourite)
Selenium
Awesomium (You'd have to roll out your own UI, it's invisible)
Cef
Essential Objects Web Browser
EDIT: I didn't think about using QA tools as the actual browser hook as #TheAnathema mentions. That would probably work for your needs.
You're going to need to create it as Chrome extension if you must be dependent on the user actually going to a specific web site (i.e. not being able to do the requests yourself with either Selenium or standard web requests in Python).
The reason why a Chrome extension would be required is because think of how bad it could be for any software to easily read the pages you browse. Banking, medical, email, etc. could all be accessed anonymously from any process if Google allowed any outside process to tap into the web page.
Even Chrome extensions have to ask for permission to be able to do what they want, but at least it is software the user knowingly installed and agreed to the permissions.
A quick search yielded this example of modifying a page's HTML with a Chrome extension: https://blog.lateral.io/2016/04/create-chrome-extension-modify-websites-html-css/
It sounds like you want to do web scraping. Here's a good tutorial to get you started: HTML Scraping.
And this answer has a good example of how to scrape data from a website where you need to submit a form to get access to the data.

Does launching app for an http link on Windows 10 require server-side changes?

I followed the guide HERE to link my app to an https URI. It works perfectly fine during testing, for both Debug and Release versions: when I click a hyperlink for the website, the app is launched instead of Edge. The OnActivated event is triggered and the app goes to the desired page, all well and good.
Keep in mind, I'm not using the LaunchUriAsync technique that opens the link only if the app is in foreground.
But when I uploaded the app to the store and downloaded it on the same device I was testing on, the app is not launched. Instead, the webpage opens in Edge. Why is this happening? Is it really mandatory to do some server-side changes to make this work? I'm afraid I don't have access to that, as my app is a third party alternative.
Can someone informed on this topic tell me how I can go about this?
Also, the app does show up under the "Apps for websites" section in Settings -> System when installed through the Store.
The document has a mistake before 8/26, The Json file name should be "windows-app-web-link", not "microsoft-app-uri-handlers". If you have referenced the previous document to lead to not work, please update.
If you still have issues after updated, please test the configuration of your app and website by running the App host registration verifier tool (Details please see the 'Test it out: Local validation tool' section of https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/web-to-app-linking)
Because according to the document,
all side loaded apps with AppUriHandlers will have validated links for the host on install. You do not need to have a JSON file uploaded to test the feature. It seems may be something wrong with the JSON file so you can have a test.

C# - How to control chrome browser

I wanted to make an application wherein you specify the name of the websites, your username and password and that application automatically logs in to all your accounts in the specified websites. I have done this using windows form application, using a web browser. But i wanted my application to open all these websites in chrome and log it in there. Plz Help
I'd check out the chrome API failing that
Look into getting a handle to the window through window API calls
But why not just a chrome extension?!? Miles simpler
Have a look at Selenium WebDriver
Doing a quick Google search for "chrome C# api" turned up a number of results I think you may find relevant.
I thought the following were particularly promising, if you're willing to accept a few concessions:
Automating Chrome Browser from C#
ChromeDevTools; a C# Library to interact with Chrome's Developer Tools
Chrome Debugging API

Open app e.g. Word then open file via FireFox (for WebDav integration)

I'm writing a custom WebDav integration for our website and in IE I can use new ActiveXObject to open e.g. Word from javascript then open a file. It's got to be like this to enable the applications WebDav integration, I can't just use a link.
We support Firefox as a browser however and new ActiveXObject doesn't work. I've toyed with writing a Silverlight 4 app which apparently can open Word on the user's desktop or even asking the user to download some sort of Console app that launches Word/Excel/etc. I don't want to do this though and I keep thinking someone must have had this issue before.
So.. is there a way to open Word from Firefox FIRST, THEN open a url from Word.
Cheers,
Adam.
UPDATE: Silverlight 4 no longer an option, don't want to use OOB
Not in plain HTML. But a firefox extension should allow this.

Categories

Resources