How to detect browser type during run-time?
Posted: Wed Dec 12, 2018 9:14 pm
Hello,
What is the best way to detect what browser is currently running Ranorex automation during run-time? For example, I have a recording with some actions that downloads a file from the web page, now the problem I have is each browser (Chrome, Firefox, Edge, IE) has a different way of saving and downloading this file, and all the elements for each browser are different as well, so the actions in the recording don't work with all browsers.
How do I automate, say, if the browser is Chrome, run these actions, or if the browser is Firefox, run these actions, etc. Is there a way, or a feature, or an action that can accomplish this decision making? If not, is there a way to code this in C#? Pseudo code would be:
if (browser == "Chrome")
{
///run these actions
}
else if (browser == "Firefox")
{
///run these actions
}
Thanks for your time.
What is the best way to detect what browser is currently running Ranorex automation during run-time? For example, I have a recording with some actions that downloads a file from the web page, now the problem I have is each browser (Chrome, Firefox, Edge, IE) has a different way of saving and downloading this file, and all the elements for each browser are different as well, so the actions in the recording don't work with all browsers.
How do I automate, say, if the browser is Chrome, run these actions, or if the browser is Firefox, run these actions, etc. Is there a way, or a feature, or an action that can accomplish this decision making? If not, is there a way to code this in C#? Pseudo code would be:
if (browser == "Chrome")
{
///run these actions
}
else if (browser == "Firefox")
{
///run these actions
}
Thanks for your time.