Suggestion on how to handle the dynamic element presence | Selenium Forum
M
Posted on 25/08/2015
Hi all,
I am trying to create a framework using the module 21.
I am in a situation in Framework creation where i am not sure how to handle the below situation.

The situation flows like

1.In a web page there might be a possibility of a presence of a droplist/input box and if the object is present i have to perform the action to select value or entering value without which i can not save the data? how this can be handle ?

2. After saving the data pop up comes.But the number of pop up displayed is again uncertain.So I have to click on each pop up ok button if those are present ?
But Yes the locator of every OK button is same.

So Can any one suggest how this situation can be handle using the frame work.

Regards
Guru

M
Replied on 26/08/2015

[color=#BF0000:2obux9ed] if the object is present [/color:2obux9ed]
use "is element present" it is explained in the modules.



[color=#BF0000:2obux9ed] "number of pop up displayed is again uncertain" [/color:2obux9ed]
you would have to use loop and "switch to" statement after that check if there are more pop up by "get window handle"


M
Replied on 26/08/2015

[quote="qtpselenium.supp0rt@gmail.com":2ipef8kg][color=#BF0000:2ipef8kg] if the object is present [/color:2ipef8kg]
use "is element present" it is explained in the modules.



[color=#BF0000:2ipef8kg] "number of pop up displayed is again uncertain" [/color:2ipef8kg]
you would have to use loop and "switch to" statement after that check if there are more pop up by "get window handle"[/quote:2ipef8kg]

Hi,
Yes we can use Is Element Present But as part of excel sheet keyword how this can be used because depending on this certain action will be performed if the element is present else some other action will be performed ?
Note : I have created Framework as per the Module 21.

Regards,
GK


M
Replied on 27/08/2015

"how this can be used because depending on this certain action will be performed if the element is present else some other action will be performed ?"

if(iselementpresent){
}
else{
}

what is the question again?


M
Replied on 27/08/2015

[quote="qtpselenium.supp0rt@gmail.com":2sn1ulsy]"how this can be used because depending on this certain action will be performed if the element is present else some other action will be performed ?"

if(iselementpresent){
}
else{
}

what is the question again?[/quote:2sn1ulsy]
Hi ,
I am creating a framework and the data is given through the excel sheet as described in Module 21.

For each action I have created a Keyword.
Every thing is working properly.
But but there are certain textbox,drop list which may appear some time or may not.
So you are suggesting me to create different different keywords as isElementPresentInput,isElementPresentDroplist
In the excelsheet,i will use the keyword isElementPresentInput with the object and data,
Code will check if the element is present then do the action else simply return pass as the element is not present. ?

Or do you suggest some thing else ?