Parameter value of Grid is not getting overridden | Selenium Forum
M
Posted on 24/11/2015
Hi Ashish / All

I have test cases which was working well in local, when I migrated the code in order to execute using Grid....I changed few setting... Please see the screenshots attached

1.jpg -> main program which has init functional, now for grid i have changed it to init(constants.ie)

connstant.ie= is the default IE Browser name

2.jpg -> init from the module, which is supposed to take the parameter from the .xml which is NOT Happening

3.jpg > .xml file

Kindly review and let me know where its going wrong.

Grid is working fine, what ever the node i configured its opennig the browser accordingly, but this value of init(constants.ie) is getting overridden. (From the Program I given as ie) and hence when I debug it always goes to the ie block of code rather than any other browser as configured in the .xml file..

Kindly advise, how to resolve this..

Thanks


Regards
J

M
Replied on 25/11/2015

we are not able to understand the problem. could you please repeat the problem.


M
Replied on 25/11/2015

Hi,

Here is the explanation

I have a testfile.java which calls the Page.java

testfile.java has init() method which calls Page.java file.. which does the initialization for the browser based on the browser type which is coming from the configuraiton.properties file.

the issue now is i am moving to Grid and I am setting the configuraiton value for browser to come from the testfile.xml hence I modified Paga.java file for init() to something like this

@parameter({browser})
init(browser b)

because init gonna accept the String object.. i have to modify the testfile also

Something like this

init(constants.ie) this value is coming from Java constant file.

The problem the browser configuraiton value is always executing and hence the above code of


@parameter which is coming from .xml file is not recognized at all...

hope you got my problem...

How to resolve this

Regards
J


M
Replied on 26/11/2015

Any update?


M
Replied on 26/11/2015

can you zip and upload your project. thank you i'll take a look at it.