Share
Go down
TurtleRock
Posts : 8
Join date : 2012-05-16

Descriptivce Programming(Similar to VBS in QTP) in webdriver.

on Mon Jul 09, 2012 7:47 pm
Is it possible to write descriptivce programming(Similar to VBS in QTP) in webdriver.
tarun3kumar
Master
Master
Posts : 186
Join date : 2012-02-14
http://seleniumtests.com

Re: Descriptivce Programming(Similar to VBS in QTP) in webdriver.

on Tue Jul 10, 2012 12:54 pm
You in fact write descriptive programming with wrapping your common code. There is no QTP kind of object repo in Selenium

_________________
Thanks
Tarun K
Free Selenium Training
TurtleRock
Posts : 8
Join date : 2012-05-16

Re: Descriptivce Programming(Similar to VBS in QTP) in webdriver.

on Wed Jul 11, 2012 6:54 pm
Yes that is correct, we dont have any Object repo in selenium. But what i need to know is can we write a set of code like in QTP(VBS) to navigate through all the TextBoxes availabel on page, chech property of all and select the appropriate one for entering values in it.

VBS Code for example:

set odesc =Descripton.create()

odesc("class").value ="TextBox"

set obj = Browser("Google").childobjects(odesc)

Can we write similar kind of coding in selenium web driver.
tarun3kumar
Master
Master
Posts : 186
Join date : 2012-02-14
http://seleniumtests.com

Re: Descriptivce Programming(Similar to VBS in QTP) in webdriver.

on Thu Jul 12, 2012 12:24 pm
indeed you can by collecting all Web Elelments in a java (or C#, php, python etc ) collection and iterating through it -

Code:
List<WebElement>checkboxes = driver.findElements(By.id("id"));
for(WebElement checkbox:checkboxes) {
    checkbox.click()
    // and do some thing more with check box element.
}

Does this help?

_________________
Thanks
Tarun K
Free Selenium Training
Sponsored content

Re: Descriptivce Programming(Similar to VBS in QTP) in webdriver.

Back to top
Permissions in this forum:
You cannot reply to topics in this forum