how to click button with SPAN tag in dropdown popup

瀏覽次數:75 次
跳到第一則未讀訊息

manasa reddy

未讀,
2018年6月4日 上午10:57:032018/6/4
收件者: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

未讀,
2018年6月4日 上午11:07:422018/6/4
收件者: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

未讀,
2018年6月4日 上午11:15:502018/6/4
收件者: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

未讀,
2018年6月4日 上午11:19:112018/6/4
收件者:seleniu...@googlegroups.com
JavaScript is the best option with keeping some wait or page to load

--

Venky

未讀,
2018年7月10日 凌晨12:34:112018/7/10
收件者:Selenium Users
Hi Manasa,

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

Devendra Singh

未讀,
2018年7月10日 凌晨1:24:472018/7/10
收件者: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.
回覆所有人
回覆作者
轉寄
0 則新訊息