Please help in getting xpath

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Please help in getting xpath

Sumit Keswani
Hi Team,

How can I get xpath of first Free app under 'All extensions'
I need to click on first Free app(not paid one) to get into app details page

I dont want to use App name, and want to keep generic solution

Below is the site:

Regards,
Sumit 

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAEDm2n_ZN1uYLR-w2HwNOk_uKB-wipirsSJ6XCM_n5k0-9bk6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Please help in getting xpath

Nagendra Kuppala
Try below:

//*[@id="app-group-all-apps"]/div[2]/div/div/ul/li[3]/div[5][contains(string(), "Free")]  
or
//*[@id="app-group-all-apps"]/div[2]/div/div/ul/li[3]/div[5][contains(span/small/following-sibling::text(), "Free")] 

Change Text "Free" same as in HTML. may include spaces

On Thursday, June 14, 2018 at 11:57:02 AM UTC-7, Sumit Keswani wrote:
Hi Team,

How can I get xpath of first Free app under 'All extensions'
I need to click on first Free app(not paid one) to get into app details page

I dont want to use App name, and want to keep generic solution

Below is the site:
<a href="https://www.adobeexchange.com/creativecloud.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.adobeexchange.com%2Fcreativecloud.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFBRBdtcw61BrEYHyg_wD0EpSMw8A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.adobeexchange.com%2Fcreativecloud.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFBRBdtcw61BrEYHyg_wD0EpSMw8A&#39;;return true;">https://www.adobeexchange.com/creativecloud.html

Regards,
Sumit 

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/a32e2257-ae60-4ccf-8422-c99039c35636%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Please help in getting xpath

Sumit Keswani
Thanks much Nagendra for your response

Actually I want to click on app title which has Free label 
Is there a way to get app xpath wrt to Free label

I can try to iterate over all Apps and click the app title which contains Free text 

On Fri, Jun 15, 2018 at 12:45 AM, Nagendra Kuppala <[hidden email]> wrote:
Try below:

//*[@id="app-group-all-apps"]/div[2]/div/div/ul/li[3]/div[5][contains(string(), "Free")]  
or
//*[@id="app-group-all-apps"]/div[2]/div/div/ul/li[3]/div[5][contains(span/small/following-sibling::text(), "Free")] 

Change Text "Free" same as in HTML. may include spaces

On Thursday, June 14, 2018 at 11:57:02 AM UTC-7, Sumit Keswani wrote:
Hi Team,

How can I get xpath of first Free app under 'All extensions'
I need to click on first Free app(not paid one) to get into app details page

I dont want to use App name, and want to keep generic solution

Below is the site:

Regards,
Sumit 

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/a32e2257-ae60-4ccf-8422-c99039c35636%40googlegroups.com.
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAEDm2n_y8L%3D1kuCmuLrpyJk68UxdN_-Rg3TcmTNtUKr3YZm%3DOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Please help in getting xpath

Mike Hetzer
This was fun.

Use this relative xpath to find all links where the app says it's "Free":

//div[@id='app-group-all-apps']//li//div//span/small[contains(text(),'Free')]/ancestor::li//div[1]//a

Then just target the first WebElement in the list/collection.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/f9feca27-0f23-4f8f-b2fd-02a9965752d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Please help in getting xpath

total QA
Hi,

for complete information on Xpath Axes locators refer to the link.


Regards,
total-qa.com

On Saturday, June 16, 2018 at 1:26:35 AM UTC+5:30, Mike Hetzer wrote:
This was fun.

Use this relative xpath to find all links where the app says it's "Free":

//div[@id='app-group-all-apps']//li//div//span/small[contains(text(),'Free')]/ancestor::li//div[1]//a

Then just target the first WebElement in the list/collection.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/56358b3b-631e-4d4d-a7d1-b99b6c373ac1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.