Question: I have a selenium script written in Python, how do I run it through jmeter?

I read it from other posting that you can choose JSR223 sampler, but it really does not have in language portion, a choice of python.
[![enter image description here](https://i.stack.imgur.com/JLKj9.png)](https://i.stack.imgur.com/JLKj9.png)

Answer: 
**Updated Solution**
I think this solution may help you. If you want to apply it on every row of your data set you can store the output in a list column. However, this function can be further improved.

```
fn <- function(x, lengths) {
  vec <- unname(unlist(x))
  lengths <- lengths

  out <- vector("list", length = length(lengths))
  for(i in seq_along(lengths)) {
    out[[i]] <- vec[c(1:lengths[i])]
    vec <- vec[-c(1:lengths[i])]
  }

  max_l <- Reduce(function(x, y) max(x, length(y)), out,
                  init = length(out[[1]]))

  t(sapply(out, function(x) c(x, rep("", max_l - length(x))))) |>
    as.data.frame()
}
fn(df, c(2, 3, 5, 3, 2))

  V1 V2 V3 V4 V5
1  a  b         
2  c  d  e      
3  f  g  h  i  j
4  k  l  m      
5  n  p  

```

We can also test it on other sample datas:

```
structure(list(v1 = "a", v2 = "b", v3 = "c", v4 = "d", v5 = "e", 
    v6 = "f", v7 = "g", v8 = "h", v9 = "i", v10 = "j"), class = "data.frame", row.names = c(NA, 
-1L)) -> df2

> fn(df2, c(2, 6, 2))
  V1 V2 V3 V4 V5 V6
1  a  b            
2  c  d  e  f  g  h
3  i  j  

> fn(df2, c(2, 3, 3, 2))
  V1 V2 V3
1  a  b   
2  c  d  e
3  f  g  h
4  i  j   

```
Although not given a logical explanation on how to compute the number of rows, here is an attempt that can tackle this question, in Base R

```
my_reshape <- function(dat){
  p <- ncol(dat)
  stopifnot(p>6)
  d <-function(x, p) x * (x + 1) - 2 - p
  e <- round(uniroot(d, c(1,20), p = p)$root)
  if(d(e, p)>0) e <- e - 1
  f <- abs(d(e, p))
  if (f>0 & f< e) {
    e <- e - 1
    f <- abs(d(e, p))
  }
  g <- c(2:e, if(f>=e)f, e:2)
  df <- cbind(stack(dat), time = sequence(g), id = rep(seq_along(g), g))
  res <- reshape(df, dir = 'wide', idvar = 'id', drop = 'ind', sep='_')[,-1]
  rownames(res) <- NULL
  res
}

```

Now we can do:

```
my_solve(df) # 15 columns
  values_1 values_2 values_3 values_4 values_5
1        a        b     <NA>     <NA>     <NA>
2        c        d        e     <NA>     <NA>
3        f        g        h        i        j
4        k        l        m     <NA>     <NA>
5        n        p     <NA>     <NA>     <NA>

my_solve(df[1:7]) # 7 columns
  values_1 values_2 values_3
1        a        b     <NA>
2        c        d        e
3        f        g     <NA>

my_solve(df[1:10]) # 10 columns
  values_1 values_2 values_3
1        a        b     <NA>
2        c        d        e
3        f        g        h
4        i        j     <NA>

my_solve(df[1:11]) # 11 columns ie 2, 7, 2 (we can not break it more than this)
  values_1 values_2 values_3 values_4 values_5 values_6 values_7
1        a        b     <NA>     <NA>     <NA>     <NA>     <NA>
2        c        d        e        f        g        h        i
3        j        k     <NA>     <NA>     <NA>     <NA>     <NA>

my_solve(df[1:13]) # 13 columns
  values_1 values_2 values_3
1        a        b     <NA>
2        c        d        e
3        f        g        h
4        i        j        k
5        l        m     <NA>

my_solve(df[1:14]) # 14 columns
  values_1 values_2 values_3 values_4
1        a        b     <NA>     <NA>
2        c        d        e     <NA>
3        f        g        h        i
4        j        k        l     <NA>
5        m        n     <NA>     <NA>

```