Discussion:
[selenium-users] The object locator values are different in 2 environment for the same app, how to take right xpath
Savita Nalawade
2018-11-15 12:51:23 UTC
Permalink
Hi,

I am using Test and Dev Environment for testing. The xpath i took for Dev
environment is not working on Test environment. The locator values ie Name
and ID are different for both.
Please help me in choosing xpath.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/36387e19-afae-42dd-a2eb-4ec70e5e8549%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ripon Al Wasim
2018-11-15 12:55:32 UTC
Permalink
Hi,
As the element has ID, it's better to use ID instead of xpath.

Java code for Selenium WebDriver is as follows:

driver.findElement(By.id(<ID of Element>));
Post by Savita Nalawade
Hi,
I am using Test and Dev Environment for testing. The xpath i took for Dev
environment is not working on Test environment. The locator values ie Name
and ID are different for both.
Please help me in choosing xpath.
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/36387e19-afae-42dd-a2eb-4ec70e5e8549%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/36387e19-afae-42dd-a2eb-4ec70e5e8549%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CADrmqWWzGnccjPYAtWPhML2YwkZr-U6qsxYGv-czsN5DKF_u6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Savita Nalawade
2018-11-15 16:55:02 UTC
Permalink
Thanks Ripon.

Here Id is different in both Environment, that is the problem. I need
solution that the same xpath will work in both environment ie Dev and Test.
Post by Ripon Al Wasim
Hi,
As the element has ID, it's better to use ID instead of xpath.
driver.findElement(By.id(<ID of Element>));
Post by Savita Nalawade
Hi,
I am using Test and Dev Environment for testing. The xpath i took for Dev
environment is not working on Test environment. The locator values ie Name
and ID are different for both.
Please help me in choosing xpath.
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/36387e19-afae-42dd-a2eb-4ec70e5e8549%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/36387e19-afae-42dd-a2eb-4ec70e5e8549%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/380dd665-d72e-4063-9c9e-4213d5cb26a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Shibi kp
2018-11-15 13:11:39 UTC
Permalink
From you image id is different from Dev and Testing Environment . Can u
please use some other attribute in the HTML webelement like name,Class,..

On Thursday, November 15, 2018 at 6:21:24 PM UTC+5:30, Savita Nalawade
Post by Savita Nalawade
Hi,
I am using Test and Dev Environment for testing. The xpath i took for Dev
environment is not working on Test environment. The locator values ie Name
and ID are different for both.
Please help me in choosing xpath.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/42ae1496-32e0-4041-ab7e-05f177e7f36c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Deepa Arvind
2018-11-16 12:51:46 UTC
Permalink
HI Savitha,

Did you check the class of Input,looks like that is not an auto generated
one, please try with the .class..
Post by Shibi kp
From you image id is different from Dev and Testing Environment . Can u
please use some other attribute in the HTML webelement like name,Class,..
On Thursday, November 15, 2018 at 6:21:24 PM UTC+5:30, Savita Nalawade
Post by Savita Nalawade
Hi,
I am using Test and Dev Environment for testing. The xpath i took for Dev
environment is not working on Test environment. The locator values ie Name
and ID are different for both.
Please help me in choosing xpath.
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/42ae1496-32e0-4041-ab7e-05f177e7f36c%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/42ae1496-32e0-4041-ab7e-05f177e7f36c%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
Thanks&Regards
Deepa
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAFWO3Wd39NhyVHAYKw6NKxUOiEq1PripBSue_KLGx5x6fZKzSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Ankit Gupta
2018-11-16 17:19:38 UTC
Permalink
Use: xpath1 | xpath2
Post by Deepa Arvind
HI Savitha,
Did you check the class of Input,looks like that is not an auto generated
one, please try with the .class..
Post by Shibi kp
From you image id is different from Dev and Testing Environment . Can u
please use some other attribute in the HTML webelement like name,Class,..
On Thursday, November 15, 2018 at 6:21:24 PM UTC+5:30, Savita Nalawade
Post by Savita Nalawade
Hi,
I am using Test and Dev Environment for testing. The xpath i took for
Dev environment is not working on Test environment. The locator values ie
Name and ID are different for both.
Please help me in choosing xpath.
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/42ae1496-32e0-4041-ab7e-05f177e7f36c%40googlegroups.com
<https://groups.google.com/d/msgid/selenium-users/42ae1496-32e0-4041-ab7e-05f177e7f36c%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
Thanks&Regards
Deepa
--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/selenium-users/CAFWO3Wd39NhyVHAYKw6NKxUOiEq1PripBSue_KLGx5x6fZKzSg%40mail.gmail.com
<https://groups.google.com/d/msgid/selenium-users/CAFWO3Wd39NhyVHAYKw6NKxUOiEq1PripBSue_KLGx5x6fZKzSg%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+***@googlegroups.com.
To post to this group, send email to selenium-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0AvuMyuTGtGhYo0YnaWP0c%2Bn0gPh3tBd8h8d3vksjz%3DtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...