Discussion:
[Cucumber] Cucumber - Selenium webdriver(running multiple browser) - Support- env.rb Configuration
(too old to reply)
'Ifeoma Emodi' via Cukes
2017-08-29 14:00:52 UTC
Permalink
Raw Message
Hi


I am new to cucumber and as well as in Ruby, am creating a project in Ruby
and this is my folder structure

Feature - Step definition
- Support - env.rb
- Gemfile
- Gemfile.lock

The issue am facing is where do I specify what browser to be used and if
both can run at the same time using the format below

Parameters("browser")

BeforeTest
public void setup(String browser){


if (browser.equalsIgnoreCase("firefox"))
{
System.setProperty("webdriver.gecko.driver",
"\Users\<name>\Desktop\Automation\Jar\geckodriver.exe");
driver = new FirefoxDriver();

}
else if (browser.equalsIgnoreCase("chrome"))
{

System.setProperty("webdriver.chrome.driver",
"\Users\<name>\Desktop\Automation\Jar\chromedriver.exe");
driver = new ChromeDriver();
}
driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
driver.manage().window().maximize();
}
Am current using Macbook and am using selenium webdriver with a little bit
of Ruby that I have learnt so far.

I will be grateful if someone can assist me with this


Thanks
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
George Dinwiddie
2017-09-13 19:30:34 UTC
Permalink
Raw Message
Ifeoma,

I typically use an environment variable to specify which browser I want
to use. Then my build script can run the tests with each browser I want
to check.

- George
Post by 'Ifeoma Emodi' via Cukes
Hi
I am new to cucumber and as well as in Ruby, am creating a project in
Ruby and this is my folder structure
Feature - Step definition
            - Support - env.rb
            -  Gemfile
            - Gemfile.lock
The issue am facing is where do I specify what browser to be used and if
both can run at the same time using the format below
Parameters("browser")
BeforeTest
    public void setup(String browser){
        if (browser.equalsIgnoreCase("firefox"))
        {
            System.setProperty("webdriver.gecko.driver",
"\Users\<name>\Desktop\Automation\Jar\geckodriver.exe");
            driver = new FirefoxDriver();
        }
        else if (browser.equalsIgnoreCase("chrome"))
        {
            System.setProperty("webdriver.chrome.driver",
"\Users\<name>\Desktop\Automation\Jar\chromedriver.exe");
            driver = new ChromeDriver();
        }
        driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
        driver.manage().window().maximize();
    }
Am current using Macbook and am using selenium webdriver with a little
bit of Ruby that I have learnt so far.
I will be grateful if someone can assist me with this
--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
80Vikram
2017-09-25 05:57:00 UTC
Permalink
Raw Message
Hi Ifeoma,

I also suggest to search for open source projects in Github.com.

I personally use this technique a lot for learning.

Regards,
Vikram
Post by 'Ifeoma Emodi' via Cukes
Hi
I am new to cucumber and as well as in Ruby, am creating a project in Ruby
and this is my folder structure
Feature - Step definition
- Support - env.rb
- Gemfile
- Gemfile.lock
The issue am facing is where do I specify what browser to be used and if
both can run at the same time using the format below
Parameters("browser")
BeforeTest
public void setup(String browser){
if (browser.equalsIgnoreCase("firefox"))
{
System.setProperty("webdriver.gecko.driver",
"\Users\<name>\Desktop\Automation\Jar\geckodriver.exe");
driver = new FirefoxDriver();
}
else if (browser.equalsIgnoreCase("chrome"))
{
System.setProperty("webdriver.chrome.driver",
"\Users\<name>\Desktop\Automation\Jar\chromedriver.exe");
driver = new ChromeDriver();
}
driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
driver.manage().window().maximize();
}
Am current using Macbook and am using selenium webdriver with a little bit
of Ruby that I have learnt so far.
I will be grateful if someone can assist me with this
Thanks
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...