how to click button with SPAN tag in dropdown popup

74 views
Skip to first unread message

manasa reddy

unread,
Jun 4, 2018, 10:57:03 AM6/4/18
to Selenium Users

Im trying to click on + in no.of passengers dropdown in spicejet website with SPAN tag 

                     <div class="ad-row-right">
                    <span class="pax-add pax-enabled" id="hrefDecAdt">-</span>
                     <span id="spanAudlt">1</span>
                     <span class="pax-add pax-enabled" id="hrefIncAdt">+</span>
                    </div>
My code:

               driver.get("http://spicejet.com/");
driver.findElement(By.xpath("//*[@id='divpaxinfo']")).click();
driver.findElement(By.xpath("//div[@id='divpaxOptions']//div[@class='ad-row-right']//span[@id='hrefIncAdt']")).click();

 getting error Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: element not visible 

bharathi sriram

unread,
Jun 4, 2018, 11:07:42 AM6/4/18
to seleniu...@googlegroups.com
if the problem is occurring on the second findElement, I would try with xpath = .//span[@class='c'].click();

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/b1e3a77c-2c9d-42e4-8c41-4773f07262d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks and Best Regards,
Bharathi

srikanth samala

unread,
Jun 4, 2018, 11:15:50 AM6/4/18
to seleniu...@googlegroups.com
Use execute java script to click

--
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-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Rajeev Rahi

unread,
Jun 4, 2018, 11:19:11 AM6/4/18
to seleniu...@googlegroups.com
JavaScript is the best option with keeping some wait or page to load

--

Venky

unread,
Jul 10, 2018, 12:34:11 AM7/10/18
to Selenium Users
Hi Manasa,

Did you get the solution , i am also struggling to get the same.
Just started learning selenium.

Devendra Singh

unread,
Jul 10, 2018, 1:24:47 AM7/10/18
to seleniu...@googlegroups.com
try it by applying "wait" after  launching spicejet site.

it will work .

Else 
capture all the element present in dropdown in List and then click on "+ or - " by relating to text (following:sibling).



--
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+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/668ceadd-bc64-43c3-bbc2-b3ef8a948779%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages